🐛 Fix navigation for shared link view (#466)

This commit is contained in:
Montassar Ghanmy
2024-03-18 11:26:08 +01:00
committed by GitHub
parent 8494145e9d
commit 33392abfeb
4 changed files with 9 additions and 4 deletions
@@ -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);
}}
/>
);