Skip to content

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

fix: sharing ulr issues on windows

Ilian Sapundshiev152a22d45947
diff --git a/app/components/EntryContainer.tsx b/app/components/EntryContainer.tsx
index 37f2c23be..5511256aa 100644
--- a/app/components/EntryContainer.tsx
+++ b/app/components/EntryContainer.tsx
@@ -384,14 +384,15 @@ function EntryContainer(props: Props) {
folderPath
);
}
- if (openedFile.isFile && params.has('tsepath')) {
+ if (params.has('tsepath')) {
const entryPath = params.get('tsepath');
- sharingLink = generateSharingLink(locationId, entryPath);
- } else if (!openedFile.isFile) {
- const dirPath = params.has('tsepath')
- ? params.get('tsepath')
- : openedFile.path;
- sharingLink = generateSharingLink(locationId, undefined, dirPath);
+ if (openedFile.isFile) {
+ sharingLink = generateSharingLink(locationId, entryPath);
+ } else {
+ sharingLink = generateSharingLink(locationId, undefined, entryPath);
+ }
+ } else {
+ sharingLink = generateSharingLink(locationId);
}
}
}
diff --git a/app/services/utils-io.ts b/app/services/utils-io.ts
index 0d8e01e1c..4929f3855 100644
--- a/app/services/utils-io.ts
+++ b/app/services/utils-io.ts
@@ -1408,7 +1408,7 @@ export function getRelativeEntryPath(
export function cleanFrontDirSeparator(dirPath) {
if (dirPath) {
if (dirPath.startsWith('\\')) {
- return dirPath.substring(2);
+ return dirPath.substring(1);
}
if (dirPath.startsWith('/')) {
return dirPath.substring(1);