Skip to content

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

Moving max collected tags limit to the config

Ilian Sapundshievc99d5aeab185
diff --git a/app/config.js b/app/config.js
index ac66264e6..4fa871a02 100644
--- a/app/config.js
+++ b/app/config.js
@@ -36,6 +36,7 @@ export default {
endTagContainer: ']',
tagDelimiter: ' ',
prefixTagContainer: '',
+ maxCollectedTag: 500,
maxThumbSize: 400,
thumbBgColor: 'black',
indexerLimit: 200000,
diff --git a/app/reducers/taglibrary.js b/app/reducers/taglibrary.js
index 72e9e93fe..165bfd751 100644
--- a/app/reducers/taglibrary.js
+++ b/app/reducers/taglibrary.js
@@ -17,13 +17,12 @@
* @flow
*/
-// import AppConfig from '../config';
import uuidv1 from 'uuid';
import { immutablySwapItems, formatDateTime4Tag, extend } from '../utils/misc';
import { saveAsTextFile } from '../services/utils-io';
import versionMeta from '../version.json';
import defaultTagLibrary from './taglibrary-default';
-// import AppConfig from '../config';
+import AppConfig from '../config';
export const types = {
CREATE_TAGGROUP: 'CREATE_TAGGROUP',
@@ -112,7 +111,7 @@ export default (state: Array<TagGroup> = defaultTagLibrary, action: Object) => {
const indexForEditing = state.findIndex(obj => obj.uuid === action.entry.uuid);
if (indexForEditing >= 0) {
const tags = [...state[indexForEditing].children, ...action.entry.children];
- tags.splice(0, tags.length - 500);
+ tags.splice(0, tags.length - AppConfig.maxCollectedTag);
return [
...state.slice(0, indexForEditing),
{