🐛 Fix navigation for shared link view (#466)
This commit is contained in:
@@ -217,6 +217,7 @@ export default memo(
|
||||
onCheck: (v: boolean) =>
|
||||
setChecked(_.pickBy({ ...checked, [child.id]: v }, _.identity)),
|
||||
onBuildContextMenu: () => onBuildContextMenu(details, child),
|
||||
inPublicSharing,
|
||||
};
|
||||
return (
|
||||
isMobile ? (
|
||||
@@ -345,7 +346,7 @@ export default memo(
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
<HeaderPath path={path || []} inTrash={inTrash} setParentId={setParentId} />
|
||||
<HeaderPath path={path || []} inTrash={inTrash} setParentId={setParentId} inPublicSharing={inPublicSharing} />
|
||||
)}
|
||||
<div className="grow" />
|
||||
|
||||
@@ -390,7 +391,7 @@ export default memo(
|
||||
onClick={() => {
|
||||
const route = RouterServices.generateRouteFromState({dirId: child.id});
|
||||
history.push(route);
|
||||
//return setParentId(child.id);
|
||||
if (inPublicSharing) return setParentId(child.id);
|
||||
}}
|
||||
checked={checked[child.id] || false}
|
||||
onCheck={v =>
|
||||
|
||||
@@ -9,6 +9,7 @@ export type DriveItemProps = {
|
||||
checked: boolean;
|
||||
onClick?: () => void;
|
||||
onBuildContextMenu: () => Promise<any[]>;
|
||||
inPublicSharing?: boolean;
|
||||
};
|
||||
|
||||
export type DriveItemOverlayProps = {
|
||||
|
||||
@@ -32,6 +32,7 @@ export const DocumentRow = ({
|
||||
checked,
|
||||
onClick,
|
||||
onBuildContextMenu,
|
||||
inPublicSharing,
|
||||
}: DriveItemProps) => {
|
||||
const history = useHistory();
|
||||
const [hover, setHover] = useState(false);
|
||||
@@ -59,6 +60,7 @@ export const DocumentRow = ({
|
||||
|
||||
const preview = () => {
|
||||
history.push(RouterServices.generateRouteFromState({companyId: company, itemId: item.id}));
|
||||
if (inPublicSharing) open(item);
|
||||
};
|
||||
|
||||
return (
|
||||
|
||||
@@ -15,10 +15,12 @@ export default ({
|
||||
path: livePath,
|
||||
inTrash,
|
||||
setParentId,
|
||||
inPublicSharing,
|
||||
}: {
|
||||
path: DriveItem[];
|
||||
inTrash?: boolean;
|
||||
setParentId: (id: string) => void;
|
||||
inPublicSharing?: boolean;
|
||||
}) => {
|
||||
const [savedPath, setSavedPath] = useState<DriveItem[]>([]);
|
||||
const history = useHistory();
|
||||
@@ -40,8 +42,7 @@ export default ({
|
||||
dirId,
|
||||
}),
|
||||
);
|
||||
console.log("viewId changed now setting the parentId")
|
||||
// setParentId(dirId ? dirId : viewId);
|
||||
if (inPublicSharing) return setParentId(dirId ? dirId : viewId);
|
||||
}}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user