TagSpaces is an offline, open source, document manager with tagging support
make updating the index optional after adding new tags
Ilian Sapundshievcf05215fb8f4
diff --git a/app/reducers/app.js b/app/reducers/app.jsindex 67a2171e9..ad90b1746 100644--- a/app/reducers/app.js+++ b/app/reducers/app.js@@ -1145,11 +1145,13 @@ export const actions = {path,entryMeta}),- reflectUpdateSidecarTags: (path: string, tags: Array<Tags>) => (+ reflectUpdateSidecarTags: (path: string, tags: Array<Tags>, updateIndex: boolean = true) => (dispatch: (actions: Object) => void) => {dispatch(actions.reflectUpdateSidecarTagsInt(path, tags));- dispatch(LocationIndexActions.reflectUpdateSidecarTags(path, tags));+ if (updateIndex) {+ dispatch(LocationIndexActions.reflectUpdateSidecarTags(path, tags));+ }},reflectUpdateSidecarMeta: (path: string, entryMeta: Object) => (dispatch: (actions: Object) => voiddiff --git a/app/reducers/tagging-actions.js b/app/reducers/tagging-actions.jsindex 316dd69ca..4ee95ab86 100644--- a/app/reducers/tagging-actions.js+++ b/app/reducers/tagging-actions.js@@ -39,7 +39,7 @@ import PlatformIO from '../services/platform-io';import { Pro } from '../pro';const actions = {- addTags: (paths: Array<string>, tags: Array<Tag>) => (+ addTags: (paths: Array<string>, tags: Array<Tag>, updateIndex?: boolean = true) => (dispatch: (actions: Object) => void,getState: () => Object) => {@@ -58,7 +58,7 @@ const actions = {});paths.map((path) => {- dispatch(actions.addTagsToEntry(path, processedTags));+ dispatch(actions.addTagsToEntry(path, processedTags, updateIndex));return true;});@@ -90,7 +90,7 @@ const actions = {}}},- addTagsToEntry: (path: string, tags: Array<Tag>) => async (+ addTagsToEntry: (path: string, tags: Array<Tag>, updateIndex?: boolean = true) => async (dispatch: (actions: Object) => void,getState: () => Object) => {@@ -117,7 +117,7 @@ const actions = {tags: newTags,};saveMetaDataPromise(path, updatedFsEntryMeta).then(() => {- dispatch(AppActions.reflectUpdateSidecarTags(path, newTags));+ dispatch(AppActions.reflectUpdateSidecarTags(path, newTags, updateIndex));return true;}).catch((err) => {console.warn('Error adding tags for ' + path + ' with ' + err);@@ -127,7 +127,7 @@ const actions = {} else {const newFsEntryMeta = { tags };saveMetaDataPromise(path, newFsEntryMeta).then(() => {- dispatch(AppActions.reflectUpdateSidecarTags(path, tags));+ dispatch(AppActions.reflectUpdateSidecarTags(path, tags, updateIndex));return true;}).catch(error => {console.warn('Error adding tags for ' + path + ' with ' + error);