Skip to content

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

feature: added ExtSaveLocationsInBrowser to extconfig

Ilian Sapundshiev6537cb1a28d1
diff --git a/app/config.ts b/app/config.ts
index 130e9ea6b..0d5e269e1 100644
--- a/app/config.ts
+++ b/app/config.ts
@@ -100,6 +100,10 @@ export const AppConfig = {
isCordova: isCordovaiOS || isCordovaAndroid,
isMobile: isCordovaiOS || isCordovaAndroid || isIOS || isAndroid,
isAmplify: window.ExtIsAmplify !== undefined ? window.ExtIsAmplify : false,
+ saveLocationsInBrowser:
+ window.ExtSaveLocationsInBrowser !== undefined
+ ? window.ExtSaveLocationsInBrowser
+ : false,
useSidecarsForFileTagging:
window.ExtUseSidecarsForFileTagging !== undefined
? window.ExtUseSidecarsForFileTagging
diff --git a/app/reducers/index.ts b/app/reducers/index.ts
index 221137197..176b33559 100644
--- a/app/reducers/index.ts
+++ b/app/reducers/index.ts
@@ -29,10 +29,20 @@ import AppConfig from '-/config';
const externalLocations = window.ExtLocations || false;
const externalTagLibrary = window.ExtTagLibrary || false;
+let locationsInBlackList = false; // electron case
+
+if (externalLocations || AppConfig.isWeb) {
+ locationsInBlackList = true;
+}
+
+if (AppConfig.saveLocationsInBrowser) {
+ locationsInBlackList = false;
+}
+
const blacklist = [
'app',
'locationIndex',
- externalLocations || AppConfig.isWeb ? 'locations' : '',
+ locationsInBlackList ? 'locations' : '',
externalTagLibrary ? 'taglibrary' : ''
];
diff --git a/app/tagspaces.d.ts b/app/tagspaces.d.ts
index aee349d19..f0f66d63c 100644
--- a/app/tagspaces.d.ts
+++ b/app/tagspaces.d.ts
@@ -38,6 +38,7 @@ declare interface Window {
ExtIsFirstRun?: boolean;
ExtIsAmplify?: boolean;
ExtUseSidecarsForFileTagging?: boolean;
+ ExtSaveLocationsInBrowser?: boolean;
ExtDefaultVerticalPanel?: string;
ExtSidebarColor?: string;
ExtSidebarSelectionColor?: string;