Skip to content

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

fix: issues with not always loading the default perspective

Ilian Sapundshiev9fa96d36b0a8
diff --git a/src/renderer/hooks/DirectoryContentContextProvider.tsx b/src/renderer/hooks/DirectoryContentContextProvider.tsx
index e485125f2..f76935dc7 100644
--- a/src/renderer/hooks/DirectoryContentContextProvider.tsx
+++ b/src/renderer/hooks/DirectoryContentContextProvider.tsx
@@ -1007,6 +1007,7 @@ export const DirectoryContentContextProvider = ({
location: CommonLocation = undefined,
): Promise<boolean> {
if (dirPath !== undefined) {
+ manualPerspective.current = 'unspecified';
/*if (
location &&
currentLocation &&
@@ -1160,7 +1161,8 @@ export const DirectoryContentContextProvider = ({
return directoryMeta.current.perspective;
}
return manualPerspective.current;
- }, [currentDirectory.current, manualPerspective.current]);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [ignored, defaultPerspective]);
function setManualDirectoryPerspective(
perspective: TS.PerspectiveType,