TagSpaces is an offline, open source, document manager with tagging support
fix; issue with relative paths on cloud locatiosn
Ilian Sapundshiev7b33795db435
diff --git a/app/reducers/app.ts b/app/reducers/app.tsindex 55f94158d..5578b56d6 100644--- a/app/reducers/app.ts+++ b/app/reducers/app.ts@@ -2416,14 +2416,18 @@ export const actions = {}const locationPath = getCleanLocationPath(targetLocation);- // setTimeout is needed for case of a location switch, if not location swith the timer is 0+ // setTimeout is needed for case of a location switch, if no location swith the timer is 0setTimeout(() => {if (isCloudLocation) {PlatformIO.enableObjectStoreSupport(targetLocation).then(() => {if (directoryPath && directoryPath.length > 0) {+ const newRelDir = getRelativeEntryPath(+ targetLocation,+ directoryPath+ );const dirFullPath =locationPath.length > 0- ? locationPath + '/' + directoryPath+ ? locationPath + '/' + newRelDir: directoryPath;dispatch(actions.loadDirectoryContent(dirFullPath, false, true)diff --git a/app/services/utils-io.ts b/app/services/utils-io.tsindex 4929f3855..7a9336223 100644--- a/app/services/utils-io.ts+++ b/app/services/utils-io.ts@@ -1396,11 +1396,12 @@ export function getRelativeEntryPath(entryPath: string): string {const entryPathCleaned = cleanTrailingDirSeparator(entryPath);- const isCloudLocation = location.type === locationType.TYPE_CLOUD;+ // const isCloudLocation = location.type === locationType.TYPE_CLOUD;const currentLocationPath = getCleanLocationPath(location);- let relEntryPath = isCloudLocation- ? entryPathCleaned- : entryPathCleaned.replace(currentLocationPath, '');+ // let relEntryPath = isCloudLocation+ // ? entryPathCleaned+ // : entryPathCleaned.replace(currentLocationPath, '');+ let relEntryPath = entryPathCleaned.replace(currentLocationPath, '');relEntryPath = cleanFrontDirSeparator(relEntryPath);return relEntryPath;}