Skip to content

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

fix navigate to parent from file properties

sytolk62cadc4f8593
diff --git a/app/components/EntryContainerMenu.tsx b/app/components/EntryContainerMenu.tsx
index dbb4d7ec9..f7f02a7db 100644
--- a/app/components/EntryContainerMenu.tsx
+++ b/app/components/EntryContainerMenu.tsx
@@ -45,8 +45,6 @@ interface Props {
openedEntry: OpenedEntry;
toggleFullScreen: () => void;
reloadDocument: () => void;
- sharingLink: string;
- sharingParentFolderLink: string;
}
function EntryContainerMenu(props: Props) {
@@ -55,13 +53,16 @@ function EntryContainerMenu(props: Props) {
handleClose,
openedEntry,
toggleFullScreen,
- sharingLink,
- sharingParentFolderLink,
reloadDocument,
} = props;
const { t } = useTranslation();
// const theme = useTheme();
- const { toggleEntryFullWidth, openLink } = useOpenedEntryContext();
+ const {
+ toggleEntryFullWidth,
+ openLink,
+ sharingLink,
+ sharingParentFolderLink,
+ } = useOpenedEntryContext();
const { readOnlyMode } = useCurrentLocationContext();
const { deleteFile } = useIOActionsContext();
const { showNotification } = useNotificationContext();
diff --git a/app/components/EntryContainerTitle.tsx b/app/components/EntryContainerTitle.tsx
index 54b2315bf..ab28498bb 100644
--- a/app/components/EntryContainerTitle.tsx
+++ b/app/components/EntryContainerTitle.tsx
@@ -242,8 +242,6 @@ function EntryContainerTitle(props: Props) {
handleClose={() => setAnchorEl(null)}
openedEntry={openedFile}
reloadDocument={reloadDocument}
- sharingLink={sharingLink}
- sharingParentFolderLink={sharingParentFolderLink}
toggleFullScreen={toggleFullScreen}
/>
</Box>
diff --git a/app/hooks/OpenedEntryContextProvider.tsx b/app/hooks/OpenedEntryContextProvider.tsx
index 9de83b0fd..4aeff2594 100644
--- a/app/hooks/OpenedEntryContextProvider.tsx
+++ b/app/hooks/OpenedEntryContextProvider.tsx
@@ -53,6 +53,7 @@ import { getLocations } from '-/reducers/locations';
import { clearURLParam, getURLParameter, updateHistory } from '-/utils/dom';
import {
cleanRootPath,
+ cleanTrailingDirSeparator,
extractContainingDirectoryPath,
extractTagsAsObjects,
generateSharingLink,
@@ -305,7 +306,11 @@ export const OpenedEntryContextProvider = ({
(location) => location.uuid === locationId,
);
const folderPath = extractContainingDirectoryPath(openedFile.path);
- if (folderPath.indexOf(folderLocation.path) === 0) {
+ if (
+ folderPath.indexOf(
+ cleanTrailingDirSeparator(folderLocation.path),
+ ) === 0
+ ) {
sharingParentFolderLink.current = generateSharingLink(
locationId,
undefined,
@@ -750,7 +755,7 @@ export const OpenedEntryContextProvider = ({
let directoryPath = dPath && decodeURIComponent(dPath);
const entryPath = ePath && decodeURIComponent(ePath);
// fix for created bookmarks files without to have tsdpath in url
- if (!directoryPath) {
+ if (!directoryPath && entryPath) {
directoryPath = extractContainingDirectoryPath(entryPath);
}
// Check for relative paths