Skip to content

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

chore: fix issue with applying tags from tag library over the tag context menu #2388

Ilian Sapundshiev4c92b8ca4ad9
diff --git a/src/renderer/hooks/DirectoryContentContextProvider.tsx b/src/renderer/hooks/DirectoryContentContextProvider.tsx
index bce8a3293..f43b690a9 100644
--- a/src/renderer/hooks/DirectoryContentContextProvider.tsx
+++ b/src/renderer/hooks/DirectoryContentContextProvider.tsx
@@ -385,8 +385,11 @@ export const DirectoryContentContextProvider = ({
useEffect(() => {
if (!firstRender) {
- reflectActions(actions).catch(console.error);
- reflectSelection(actions);
+ reflectActions(actions)
+ .then(() => {
+ reflectSelection(actions);
+ })
+ .catch(console.error);
}
}, [actions]);
@@ -502,6 +505,7 @@ export const DirectoryContentContextProvider = ({
}
}
if (updated) {
+ setSelectedEntries([]);
setSelectedEntries(selected);
}
}
@@ -1264,7 +1268,6 @@ export const DirectoryContentContextProvider = ({
meta: {
...(entry.meta && entry.meta),
...meta,
- // description: getDescriptionPreview(meta.description, 200),
},
},
tagDelimiter,
@@ -1289,7 +1292,6 @@ export const DirectoryContentContextProvider = ({
return {
...(metaAdd && metaAdd),
...meta,
- // description: getDescriptionPreview(meta.description, 200),
};
}
return undefined;
@@ -1310,7 +1312,6 @@ export const DirectoryContentContextProvider = ({
return {
...(metaAdd && metaAdd),
...meta,
- // description: getDescriptionPreview(meta.description, 200),
};
}
return undefined;
diff --git a/src/renderer/hooks/TaggingActionsContextProvider.tsx b/src/renderer/hooks/TaggingActionsContextProvider.tsx
index 46cd6ff5e..9a1e56724 100644
--- a/src/renderer/hooks/TaggingActionsContextProvider.tsx
+++ b/src/renderer/hooks/TaggingActionsContextProvider.tsx
@@ -16,19 +16,17 @@
*
*/
-import React, { createContext, useCallback, useMemo, useState } from 'react';
-import { useSelector } from 'react-redux';
-import mgrs from 'mgrs';
+import AppConfig from '-/AppConfig';
+import LoadingLazy from '-/components/LoadingLazy';
+import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
+import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
+import { useEditedEntryContext } from '-/hooks/useEditedEntryContext';
+import { useEditedTagLibraryContext } from '-/hooks/useEditedTagLibraryContext';
+import { useIOActionsContext } from '-/hooks/useIOActionsContext';
+import { useLocationIndexContext } from '-/hooks/useLocationIndexContext';
+import { useNotificationContext } from '-/hooks/useNotificationContext';
+import { useTagGroupsLocationContext } from '-/hooks/useTagGroupsLocationContext';
import { Pro } from '-/pro';
-import { useTranslation } from 'react-i18next';
-import { TS } from '-/tagspaces.namespace';
-import OpenLocationCode from 'open-location-code-typescript';
-import {
- immutablySwapItems,
- formatDateTime4Tag,
-} from '@tagspaces/tagspaces-common/misc';
-import { setTagLibrary } from '-/services/taglibrary-utils';
-import { isGeoTag } from '-/utils/geo';
import {
getAddTagsToLibrary,
getFileNameTagPlace,
@@ -40,6 +38,15 @@ import {
getTagDelimiter,
getTagTextColor,
} from '-/reducers/settings';
+import { setTagLibrary } from '-/services/taglibrary-utils';
+import { getAllTags } from '-/services/utils-io';
+import { TS } from '-/tagspaces.namespace';
+import { CommonLocation } from '-/utils/CommonLocation';
+import { isGeoTag } from '-/utils/geo';
+import {
+ formatDateTime4Tag,
+ immutablySwapItems,
+} from '@tagspaces/tagspaces-common/misc';
import {
extractContainingDirectoryPath,
extractFileName,
@@ -48,18 +55,11 @@ import {
generateFileName,
} from '@tagspaces/tagspaces-common/paths';
import { getUuid } from '@tagspaces/tagspaces-common/utils-io';
-import { useNotificationContext } from '-/hooks/useNotificationContext';
-import { useCurrentLocationContext } from '-/hooks/useCurrentLocationContext';
-import { useLocationIndexContext } from '-/hooks/useLocationIndexContext';
-import { useEditedEntryContext } from '-/hooks/useEditedEntryContext';
-import { useIOActionsContext } from '-/hooks/useIOActionsContext';
-import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
-import { useTagGroupsLocationContext } from '-/hooks/useTagGroupsLocationContext';
-import AppConfig from '-/AppConfig';
-import { useEditedTagLibraryContext } from '-/hooks/useEditedTagLibraryContext';
-import { CommonLocation } from '-/utils/CommonLocation';
-import LoadingLazy from '-/components/LoadingLazy';
-import { getAllTags } from '-/services/utils-io';
+import mgrs from 'mgrs';
+import OpenLocationCode from 'open-location-code-typescript';
+import React, { createContext, useCallback, useMemo, useState } from 'react';
+import { useTranslation } from 'react-i18next';
+import { useSelector } from 'react-redux';
type TaggingActionsContextData = {
addTagsToFsEntries: (
@@ -288,7 +288,7 @@ export const TaggingActionsContextProvider = ({
const processedTags = [];
tags.map((pTag) => {
const tag = { ...pTag };
- tag.type = persistTagsInSidecarFile ? 'sidecar' : 'plain';
+ // tag.type = persistTagsInSidecarFile ? 'sidecar' : 'plain';
if (tag.id) {
delete tag.id;
}