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 950406b7..2f250e42 100644
--- a/tdrive/frontend/src/app/views/client/body/drive/browser.tsx
+++ b/tdrive/frontend/src/app/views/client/body/drive/browser.tsx
@@ -239,7 +239,7 @@ export default memo(
{viewId == 'shared-with-me' ? (
<>
>}>
-
+
>
@@ -263,9 +263,8 @@ export default memo(
}}
onDragOver={handleDragOver}
onDrop={handleDrop}
-
>
- {role == "admin" && }
+ {role == 'admin' && }
@@ -274,7 +273,7 @@ export default memo(
>}>
-
+
) : (
-
+
)}
@@ -375,17 +379,17 @@ export default memo(
)}
-
-
{folders.length > 0 && (
<>
-
{Languages.t('scenes.app.drive.folders')}
+
+ {Languages.t('scenes.app.drive.folders')}
+
{folders.map((child, index) => (
- {
- const route = RouterServices.generateRouteFromState({dirId: child.id});
+ const route = RouterServices.generateRouteFromState({
+ dirId: child.id,
+ });
history.push(route);
if (inPublicSharing) return setParentId(child.id);
}}
@@ -420,7 +426,11 @@ export default memo(
<>
{Languages.t('scenes.app.drive.drag_and_drop')}
-
)}
- {documents.map((child, index) => (
- draggableMarkup(index, child)
- ))}
+ {documents.map((child, index) => draggableMarkup(index, child))}
{activeIndex ? (
-
- ): null}
+
+ ) : null}
-
-
+
)}
-
>
);
},
diff --git a/tdrive/frontend/src/app/views/client/side-bar/actions.tsx b/tdrive/frontend/src/app/views/client/side-bar/actions.tsx
index 2c6cc9ea..fed67e49 100644
--- a/tdrive/frontend/src/app/views/client/side-bar/actions.tsx
+++ b/tdrive/frontend/src/app/views/client/side-bar/actions.tsx
@@ -14,7 +14,7 @@ import { UploadModelAtom, UploadModal } from '../body/drive/modals/upload'
import { Button } from '@atoms/button/button';
import Languages from "features/global/services/languages-service";
import { useCurrentUser } from 'app/features/users/hooks/use-current-user';
-import RouterServices from '@features/router/services/router-service';
+import useRouteState from 'app/features/router/hooks/use-route-state';
export const CreateModalWithUploadZones = ({ initialParentId }: { initialParentId?: string }) => {
const companyId = useRouterCompany();
@@ -95,8 +95,8 @@ export const CreateModalWithUploadZones = ({ initialParentId }: { initialParentI
export default () => {
const { user } = useCurrentUser();
- const { viewId } = RouterServices.getStateFromRoute();
- const [parentId, _] = useRecoilState(DriveCurrentFolderAtom({ initialFolderId: 'user_'+user?.id }));
+ const { viewId, dirId } = useRouteState();
+ const [parentId, _] = useRecoilState(DriveCurrentFolderAtom({ initialFolderId: dirId || viewId || 'user_'+user?.id }));
const { access, item } = useDriveItem(parentId);
const { children: trashChildren } = useDriveItem(viewId === 'trash' ? 'trash' : 'trash_'+user?.id);
const uploadZoneRef = useRef(null);
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 1c778189..f9e0b3f6 100644
--- a/tdrive/frontend/src/app/views/client/side-bar/index.tsx
+++ b/tdrive/frontend/src/app/views/client/side-bar/index.tsx
@@ -44,7 +44,6 @@ 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]);