Skip to content

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

Manage in extconfig enabling using location tags (#2303)

Stanimir83ccc1defd3b
diff --git a/src/renderer/components/dialogs/components/SettingsAdvanced.tsx b/src/renderer/components/dialogs/components/SettingsAdvanced.tsx
index dd3d4956b..24e1d6686 100644
--- a/src/renderer/components/dialogs/components/SettingsAdvanced.tsx
+++ b/src/renderer/components/dialogs/components/SettingsAdvanced.tsx
@@ -395,7 +395,7 @@ function SettingsAdvanced(props: Props) {
/>
<Switch
data-tid="saveTagInLocationTID"
- disabled={!Pro}
+ disabled={!Pro && !(typeof window.ExtUseLocationTags === 'undefined')}
onClick={() => setSaveTagInLocation(!settings.saveTagInLocation)}
checked={settings.saveTagInLocation}
/>
diff --git a/src/renderer/reducers/settings-default.ts b/src/renderer/reducers/settings-default.ts
index 94eb6ccb7..9b092ace5 100644
--- a/src/renderer/reducers/settings-default.ts
+++ b/src/renderer/reducers/settings-default.ts
@@ -57,7 +57,10 @@ export default {
maxSearchResult: 1000,
desktopMode,
devMode: window.ExtDevMode ? window.ExtDevMode : false,
- saveTagInLocation: false,
+ saveTagInLocation:
+ typeof window.ExtUseLocationTags === 'undefined'
+ ? false
+ : window.ExtUseLocationTags,
newHTMLFileContent:
'<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body></body></html>',
showUnixHiddenEntries: false,
diff --git a/src/renderer/reducers/settings.ts b/src/renderer/reducers/settings.ts
index 152de7682..0e7af784f 100644
--- a/src/renderer/reducers/settings.ts
+++ b/src/renderer/reducers/settings.ts
@@ -1078,7 +1078,9 @@ export const getStoredSearchesVisible = (state: any) =>
state.settings.storedSearchesVisible;
export const getShowBookmarks = (state: any) => state.settings.showBookmarks;
export const getSaveTagInLocation = (state: any) =>
- state.settings.saveTagInLocation;
+ typeof window.ExtUseLocationTags === 'undefined'
+ ? state.settings.saveTagInLocation
+ : window.ExtUseLocationTags;
export const getFileOpenHistory = (state: any) =>
state.settings.fileOpenHistory;
export const getFolderOpenHistory = (state: any) =>
diff --git a/src/renderer/tagspaces.d.ts b/src/renderer/tagspaces.d.ts
index 2ffe17d5b..0e159e02d 100644
--- a/src/renderer/tagspaces.d.ts
+++ b/src/renderer/tagspaces.d.ts
@@ -77,6 +77,7 @@ declare interface Window {
ExtShowTSLogo?: boolean;
ExtShowTSVersion?: boolean;
ExtUseOnlyTagsFromTagLibrary?: boolean;
+ ExtUseLocationTags?: boolean;
}
declare interface NodeModule {