From 7f351426979b2bfa19760006b9a30f25f94323db Mon Sep 17 00:00:00 2001 From: Aymeric <123820772+Aymerix01@users.noreply.github.com> Date: Thu, 27 Jul 2023 10:46:16 +0200 Subject: [PATCH] Persist current view after opening a file (#166) (#168) --- .../frontend/src/app/features/drive/hooks/use-drive-preview.ts | 2 +- .../frontend/src/app/features/router/services/router-service.ts | 1 + .../src/app/views/client/body/drive/documents/document-row.tsx | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tdrive/frontend/src/app/features/drive/hooks/use-drive-preview.ts b/tdrive/frontend/src/app/features/drive/hooks/use-drive-preview.ts index ae15f1a0..ebab9c82 100644 --- a/tdrive/frontend/src/app/features/drive/hooks/use-drive-preview.ts +++ b/tdrive/frontend/src/app/features/drive/hooks/use-drive-preview.ts @@ -31,7 +31,7 @@ export const useDrivePreviewModal = () => { const close = () => { setStatus({ item: null, loading: true }); - history.push(RouterServices.generateRouteFromState({companyId: company, viewId: "", itemId: ""})); + history.push(RouterServices.generateRouteFromState({companyId: company, itemId: ""})); } return { open, close, isOpen: !!status.item }; diff --git a/tdrive/frontend/src/app/features/router/services/router-service.ts b/tdrive/frontend/src/app/features/router/services/router-service.ts index 06235326..0d55298c 100644 --- a/tdrive/frontend/src/app/features/router/services/router-service.ts +++ b/tdrive/frontend/src/app/features/router/services/router-service.ts @@ -51,6 +51,7 @@ class RouterServices extends Observable { '/client/:companyId', '/client/:companyId/v/:viewId', '/client/:companyId/preview/:itemId', + '/client/:companyId/v/:viewId/preview/:itemId', '/client/:companyId/w/:workspaceId', '/client/:companyId/w/:workspaceId/c/:channelId', '/client/:companyId/w/:workspaceId/c/:channelId/t/:threadId', 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 b1f140da..d362e678 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 @@ -57,7 +57,7 @@ export const DocumentRow = ({ const device = getDevice(); console.log("DEVICE:: " + device); if (device != "ios" && device != "android") { - history.push(RouterServices.generateRouteFromState({companyId: company, viewId: "", itemId: item.id})); + history.push(RouterServices.generateRouteFromState({companyId: company, itemId: item.id})); open(item); } };