Skip to content

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

fixes

sytolk38374f21b9dd
diff --git a/src/main/mainEvents.ts b/src/main/mainEvents.ts
index b4b5e5f5b..c1f48a016 100644
--- a/src/main/mainEvents.ts
+++ b/src/main/mainEvents.ts
@@ -553,7 +553,16 @@ export default function loadMainEvents() {
});
ipcMain.handle('getDirProperties', async (event, path) => {
- const result = await getDirProperties(path);
- return result;
+ try {
+ const result = await getDirProperties(path);
+ return result; // renderer.invoke() resolves with this
+ } catch (err) {
+ console.error('Error in getDirProperties:', err);
+ throw {
+ message: `Failed to getDirProperties "${path}"`,
+ code: err.code || 'UNKNOWN',
+ stack: err.stack,
+ };
+ }
});
}
diff --git a/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx b/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx
index 1c6c4608d..f03ca1851 100644
--- a/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx
+++ b/src/renderer/components/dialogs/MoveCopyFilesDialog.tsx
@@ -75,14 +75,14 @@ function MoveCopyFilesDialog(props: Props) {
!currentLocation.haveWebDavSupport()
) {
const promises = selectedDirs.map((dirPath) => {
- try {
- return getDirProperties(dirPath).then((prop) => {
+ return getDirProperties(dirPath)
+ .then((prop) => {
dirProp.current[dirPath] = prop;
return true;
+ })
+ .catch((ex) => {
+ console.debug('getDirProperties:', ex);
});
- } catch (ex) {
- console.debug('getDirProperties:', ex);
- }
});
Promise.all(promises).then(() => forceUpdate());
}
diff --git a/src/renderer/hooks/EditedKanBanMetaContextProvider.tsx b/src/renderer/hooks/EditedKanBanMetaContextProvider.tsx
deleted file mode 100644
index d140a5dc0..000000000
--- a/src/renderer/hooks/EditedKanBanMetaContextProvider.tsx
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * TagSpaces - universal file and folder organizer
- * Copyright (C) 2023-present TagSpaces GmbH
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License (version 3) as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
- *
- */
-/*
-import React, { createContext, useMemo, useReducer, useRef } from 'react';
-import { TS } from '-/tagspaces.namespace';
-
-type EditedKanBanMetaContextData = {
- kanbanActions: TS.KanBanMetaActions[];
- setReflectKanBanActions: (...actionsArray: TS.KanBanMetaActions[]) => void;
-};
-
-export const EditedKanBanMetaContext =
- createContext<EditedKanBanMetaContextData>({
- kanbanActions: undefined,
- setReflectKanBanActions: undefined,
- });
-
-export type EditedKanBanMetaContextProviderProps = {
- children: React.ReactNode;
-};
-
-export const EditedKanBanMetaContextProvider = ({
- children,
-}: EditedKanBanMetaContextProviderProps) => {
- const metaActions = useRef<TS.KanBanMetaActions[]>(undefined);
-
- const [ignored, forceUpdate] = useReducer((x) => x + 1, 0, undefined);
-
- function setReflectKanBanActions(...actionsArray: TS.KanBanMetaActions[]) {
- metaActions.current = actionsArray;
- forceUpdate();
- }
-
- const context = useMemo(() => {
- return {
- kanbanActions: metaActions.current,
- setReflectKanBanActions,
- };
- }, [metaActions.current]);
-
- return (
- <EditedKanBanMetaContext.Provider value={context}>
- {children}
- </EditedKanBanMetaContext.Provider>
- );
-};
-*/
diff --git a/src/renderer/hooks/IOActionsContextProvider.tsx b/src/renderer/hooks/IOActionsContextProvider.tsx
index 219548760..2ada06c44 100644
--- a/src/renderer/hooks/IOActionsContextProvider.tsx
+++ b/src/renderer/hooks/IOActionsContextProvider.tsx
@@ -77,6 +77,7 @@ import { Pro } from '-/pro';
import { CommonLocation } from '-/utils/CommonLocation';
import { useLocationIndexContext } from '-/hooks/useLocationIndexContext';
import useFirstRender from '-/utils/useFirstRender';
+import { usePerspectiveActionsContext } from '-/hooks/usePerspectiveActionsContext';
type IOActionsContextData = {
createDirectory: (directoryPath: string) => Promise<boolean>;
@@ -292,6 +293,7 @@ export const IOActionsContextProvider = ({
saveBinaryFilePromise,
deleteEntriesPromise,
} = usePlatformFacadeContext();
+ const { setActions } = usePerspectiveActionsContext();
const { actions, setReflectActions } = useEditedEntryContext();
const { setReflectMetaActions } = useEditedEntryMetaContext();
const {
@@ -335,7 +337,7 @@ export const IOActionsContextProvider = ({
);
}
}
- } else if (action.action === 'update') {
+ } /* else if (action.action === 'update') {
// reflect visibility change on renamed KanBan column
if (
action.entry &&
@@ -354,7 +356,7 @@ export const IOActionsContextProvider = ({
reflectRenameVisibility(action.oldEntryPath, action.entry.path);
}
}
- }
+ }*/
}
}
}, [actions]);
@@ -2138,11 +2140,8 @@ export const IOActionsContextProvider = ({
if (folders) {
setCurrentDirectoryDirs(folders);
}
- /* const action: TS.KanBanMetaActions = {
- action: 'directoryVisibilityChange',
- meta: updatedFsEntryMeta,
- };
- setReflectKanBanActions(action);*/
+ const action: TS.PerspectiveActions = { action: 'reload' };
+ setActions(action);
})
.catch((err) => {
console.log(
@@ -2242,11 +2241,8 @@ export const IOActionsContextProvider = ({
if (folders) {
setCurrentDirectoryDirs(folders);
}
- /*const action: TS.KanBanMetaActions = {
- action: 'directoryVisibilityChange',
- meta: updatedFsEntryMeta,
- };
- setReflectKanBanActions(action);*/
+ const action: TS.PerspectiveActions = { action: 'reload' };
+ setActions(action);
})
.catch((err) => {
console.log(
diff --git a/src/renderer/tagspaces.namespace.d.ts b/src/renderer/tagspaces.namespace.d.ts
index 4ef5bbb41..6b1328eeb 100644
--- a/src/renderer/tagspaces.namespace.d.ts
+++ b/src/renderer/tagspaces.namespace.d.ts
@@ -144,11 +144,6 @@ export namespace TS {
action: 'openNext' | 'openPrevious' | 'reload';
}
- /* interface KanBanMetaActions {
- action: 'directoryVisibilityChange';
- meta: TS.FileSystemEntryMeta;
- }*/
-
interface Tag {
title?: string;
/**