Skip to content

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

feat: skip opening default location while opening tslinks

Ilian Sapundshievc4bb6a5b0a02
diff --git a/app/reducers/app.ts b/app/reducers/app.ts
index 1b772a320..adc11dc8b 100644
--- a/app/reducers/app.ts
+++ b/app/reducers/app.ts
@@ -889,10 +889,6 @@ export const actions = {
dispatch(SettingsActions.setZoomRestoreApp());
dispatch(SettingsActions.upgradeSettings()); // TODO call this only on app version update
const state = getState();
- const defaultLocationId = getDefaultLocationId(state);
- if (defaultLocationId && defaultLocationId.length > 0) {
- dispatch(actions.openLocationById(defaultLocationId));
- }
if (getCheckForUpdateOnStartup(state)) {
dispatch(SettingsActions.checkForUpdate());
}
@@ -912,15 +908,18 @@ export const actions = {
dispatch(SettingsActions.setLanguage(langURLParam));
}
+ let openDefaultLocation = true;
const lid = getURLParameter('tslid');
const dPath = getURLParameter('tsdpath');
const ePath = getURLParameter('tsepath');
const cmdOpen = getURLParameter('cmdopen');
if (lid || dPath || ePath) {
+ openDefaultLocation = false;
setTimeout(() => {
dispatch(actions.openLink(window.location.href));
}, 1000);
} else if (cmdOpen) {
+ openDefaultLocation = false;
setTimeout(() => {
dispatch(
actions.openLink(
@@ -929,6 +928,14 @@ export const actions = {
);
}, 1000);
}
+ const defaultLocationId = getDefaultLocationId(state);
+ if (
+ openDefaultLocation &&
+ defaultLocationId &&
+ defaultLocationId.length > 0
+ ) {
+ dispatch(actions.openLocationById(defaultLocationId));
+ }
},
goOnline: () => ({ type: types.DEVICE_ONLINE }),
goOffline: () => ({ type: types.DEVICE_OFFLINE }),