Skip to content

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

fix: add tags not reflected in search results (#1836)

Stanimird98a6d0ab4ec
diff --git a/app/components/SearchAutocomplete.tsx b/app/components/SearchAutocomplete.tsx
index b1ca289ff..f84bfd556 100644
--- a/app/components/SearchAutocomplete.tsx
+++ b/app/components/SearchAutocomplete.tsx
@@ -28,7 +28,9 @@ import IconButton from '@mui/material/IconButton';
import {
actions as AppActions,
getCurrentLocationId,
+ getDirectoryContent,
getDirectoryPath,
+ getEditedEntryPaths,
isSearchMode
} from '../reducers/app';
import {
@@ -99,6 +101,7 @@ interface Props {
currentLocationId: string;
openFsEntry: (fsEntry: TS.FileSystemEntry) => void;
searches: Array<TS.SearchQuery>;
+ editedEntryPaths: Array<TS.EditedEntryPath>;
}
const useStyles = makeStyles(theme => ({
@@ -178,16 +181,24 @@ function SearchAutocomplete(props: Props) {
const firstRender = useFirstRender();
useEffect(() => {
+ // Handle CHANGE LOCATION IN SEARCH MODE
if (!firstRender) {
- if (
- props.open &&
- (inputValue.current.length > 0 || actionValues.current.length > 0)
- ) {
+ if (props.isSearchMode && Object.keys(props.searchQuery).length > 0) {
+ // if (props.open && (inputValue.current.length > 0 || actionValues.current.length > 0)
executeSearch();
}
}
}, [props.currentLocation]);
+ useEffect(() => {
+ // HANDLE CHANGE currentDirectoryEntries (ADD/REMOVE TAGS) IN SEARCH RESULTS
+ if (!firstRender) {
+ if (props.isSearchMode && Object.keys(props.searchQuery).length > 0) {
+ executeSearch();
+ }
+ }
+ }, [props.editedEntryPaths]);
+
useEffect(() => {
if (!firstRender) {
if (!props.isSearchMode) {
@@ -1443,7 +1454,8 @@ function mapStateToProps(state) {
currentLocation: getCurrentLocation(state),
isSearchMode: isSearchMode(state),
currentLocationId: getCurrentLocationId(state),
- searches: getSearches(state)
+ searches: getSearches(state),
+ editedEntryPaths: getEditedEntryPaths(state)
};
}
diff --git a/configs/webpack.config.renderer.dev.babel.js b/configs/webpack.config.renderer.dev.babel.js
index 84b37a2dd..a64df6b09 100644
--- a/configs/webpack.config.renderer.dev.babel.js
+++ b/configs/webpack.config.renderer.dev.babel.js
@@ -42,7 +42,7 @@ if (!requiredByDLLConfig && !(fs.existsSync(dll) && fs.existsSync(manifest))) {
export default merge(baseConfig, {
cache: false,
- devtool: 'inline-source-map', // eval-source-map
+ devtool: 'eval-source-map', // inline-source-map
mode: 'development',