From 8c2b84ed8465313d0c118bcc57629dcb2e17efb1 Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Mon, 4 Mar 2024 23:16:08 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20router=20navigation=20(#39?= =?UTF-8?q?6)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Monta --- .../src/app/views/client/body/drive/browser.tsx | 4 ++-- .../client/body/drive/documents/document-row.tsx | 2 +- .../app/views/client/body/drive/header-path.tsx | 16 ++++++++-------- .../src/app/views/client/side-bar/index.tsx | 10 +++++----- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tdrive/frontend/src/app/views/client/body/drive/browser.tsx b/tdrive/frontend/src/app/views/client/body/drive/browser.tsx index 99bdaa89..2cde4fde 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/browser.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/browser.tsx @@ -383,8 +383,8 @@ export default memo( } item={child} onClick={() => { - const route = RouterServices.generateRouteFromState({dirId: child.id}); - history.push(route); + // const route = RouterServices.generateRouteFromState({dirId: child.id}); + // history.push(route); return setParentId(child.id); }} checked={checked[child.id] || false} diff --git a/tdrive/frontend/src/app/views/client/body/drive/documents/document-row.tsx b/tdrive/frontend/src/app/views/client/body/drive/documents/document-row.tsx index 37ae306c..0d8f1e9e 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/documents/document-row.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/documents/document-row.tsx @@ -58,7 +58,7 @@ export const DocumentRow = ({ console.log("DEVICE:: " + device); if (device != "ios" && device != "android") { history.push(RouterServices.generateRouteFromState({companyId: company, itemId: item.id, dirId: ''})); - open(item); + //open(item); } }; diff --git a/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx b/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx index 0cbb3a07..18f81433 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx @@ -33,13 +33,13 @@ export default ({ inTrash={inTrash || false} path={path} onClick={(viewId, dirId) => { - history.push( + /*history.push( RouterServices.generateRouteFromState({ companyId: company, viewId, dirId, }), - ); + );*/ setParentId(dirId ? dirId : viewId); }} /> @@ -128,7 +128,7 @@ const PathItem = ({ const { user } = useCurrentUser(); const { viewId } = RouterServices.getStateFromRoute(); const { access: trashAccess } = useDriveItem('trash'); - const isInSharedWithMe = viewId === "shared_with_me"; + const isInSharedWithMe = viewId === 'shared_with_me'; return (
)} - {first && !!user?.id && viewId != "shared_with_me" && ( + {first && !!user?.id && viewId != 'shared_with_me' && ( diff --git a/tdrive/frontend/src/app/views/client/side-bar/index.tsx b/tdrive/frontend/src/app/views/client/side-bar/index.tsx index a9849003..1c86c1f4 100644 --- a/tdrive/frontend/src/app/views/client/side-bar/index.tsx +++ b/tdrive/frontend/src/app/views/client/side-bar/index.tsx @@ -44,6 +44,7 @@ export default () => { if (sharedWithMe) folderType = 'shared'; useEffect(() => { + console.log('PARENT ID CHANGED: ', parentId); !itemId && !dirId && viewId && setParentId(viewId); dirId && viewId && setParentId(dirId); }, [viewId, itemId, dirId]); @@ -76,7 +77,7 @@ export default () => { dirId: '', }), ); - setParentId('user_' + user?.id); + // setParentId('user_' + user?.id); }} size="lg" theme="white" @@ -92,6 +93,7 @@ export default () => { {FeatureTogglesService.isActiveFeatureName(FeatureNames.COMPANY_SHARED_DRIVE) && ( )} @@ -123,7 +123,7 @@ export default () => { dirId: '', }), ); - setParentId('shared_with_me'); + // setParentId('shared_with_me'); }} size="lg" theme="white" @@ -164,7 +164,7 @@ export default () => { dirId: '', }), ); - setParentId('trash_' + user?.id); + // setParentId('trash_' + user?.id); }} size="lg" theme="white"