Skip to content

TagSpaces is an offline, open source, document manager with tagging support

fix DirectoryMenu

sytolk2e1ff722cf43
diff --git a/app/perspectives/grid-perspective/components/MainContainer.tsx b/app/perspectives/grid-perspective/components/MainContainer.tsx
index 9fe6b3ff6..3600ed9ec 100644
--- a/app/perspectives/grid-perspective/components/MainContainer.tsx
+++ b/app/perspectives/grid-perspective/components/MainContainer.tsx
@@ -122,6 +122,7 @@ function GridPerspective(props: Props) {
// const selectedEntry = useRef<FileSystemEntry>(undefined);
const selectedEntryPath = useRef<string>(undefined);
const selectedTag = useRef<TS.Tag | null>(null);
+ const perspectiveMode = useRef<boolean>(true);
const [
fileContextMenuAnchorEl,
setFileContextMenuAnchorEl
@@ -514,6 +515,7 @@ function GridPerspective(props: Props) {
if (selectedEntries.length > 0) {
handleSetSelectedEntries([]);
}
+ perspectiveMode.current = false;
setDirContextMenuAnchorEl(event.currentTarget);
};
@@ -774,14 +776,17 @@ function GridPerspective(props: Props) {
{/* {Boolean(dirContextMenuAnchorEl) && ( // todo move dialogs from DirectoryMenu */}
<DirectoryMenu
open={Boolean(dirContextMenuAnchorEl)}
- onClose={() => setDirContextMenuAnchorEl(null)}
+ onClose={() => {
+ setDirContextMenuAnchorEl(null);
+ perspectiveMode.current = true;
+ }}
anchorEl={dirContextMenuAnchorEl}
mouseX={mouseX}
mouseY={mouseY}
directoryPath={lastSelectedEntryPath}
openRenameDirectoryDialog={openRenameEntryDialog}
openMoveCopyFilesDialog={openMoveCopyFilesDialog}
- perspectiveMode={false}
+ perspectiveMode={perspectiveMode.current}
openAddRemoveTagsDialog={openAddRemoveTagsDialog}
/>
{/* {Boolean(tagContextMenuAnchorEl) && ( // TODO EntryTagMenu is used in TagSelect we cannot move confirm dialog from menu */}
diff --git a/app/perspectives/list/components/MainContainer.tsx b/app/perspectives/list/components/MainContainer.tsx
index c2b376ad7..26b4c74fa 100644
--- a/app/perspectives/list/components/MainContainer.tsx
+++ b/app/perspectives/list/components/MainContainer.tsx
@@ -122,6 +122,7 @@ function ListPerspective(props: Props) {
// const selectedEntry = useRef<FileSystemEntry>(undefined);
const selectedEntryPath = useRef<string>(undefined);
const selectedTag = useRef<TS.Tag | null>(null);
+ const perspectiveMode = useRef<boolean>(true);
const [
fileContextMenuAnchorEl,
setFileContextMenuAnchorEl
@@ -507,6 +508,7 @@ function ListPerspective(props: Props) {
if (selectedEntries.length > 0) {
handleSetSelectedEntries([]);
}
+ perspectiveMode.current = false;
setDirContextMenuAnchorEl(event.currentTarget);
};
@@ -765,14 +767,17 @@ function ListPerspective(props: Props) {
{/* {Boolean(dirContextMenuAnchorEl) && ( // todo move dialogs from DirectoryMenu */}
<DirectoryMenu
open={Boolean(dirContextMenuAnchorEl)}
- onClose={() => setDirContextMenuAnchorEl(null)}
+ onClose={() => {
+ setDirContextMenuAnchorEl(null);
+ perspectiveMode.current = true;
+ }}
anchorEl={dirContextMenuAnchorEl}
mouseX={mouseX}
mouseY={mouseY}
directoryPath={lastSelectedEntryPath}
openRenameDirectoryDialog={openRenameEntryDialog}
openMoveCopyFilesDialog={openMoveCopyFilesDialog}
- perspectiveMode={false}
+ perspectiveMode={perspectiveMode.current}
openAddRemoveTagsDialog={openAddRemoveTagsDialog}
/>
{/* {Boolean(tagContextMenuAnchorEl) && ( // TODO EntryTagMenu is used in TagSelect we cannot move confirm dialog from menu */}