TagSpaces is an offline, open source, document manager with tagging support
making opening of a location after creation configurable
Ilian Sapundshiev5a9b7fa0a6c2
diff --git a/app/components/LocationManager.js b/app/components/LocationManager.jsindex 2232377c8..6fd5a2435 100644--- a/app/components/LocationManager.js+++ b/app/components/LocationManager.js@@ -83,7 +83,7 @@ type Props = {openDirectory: (path: string) => void,showInFileManager: (path: string) => void,createDirectoryIndex: (path: string) => void,- addLocation: (location: Location) => void,+ addLocation: (location: Location, openAfterCreate: boolean) => void,editLocation: () => void,moveLocationUp: (locationId: string) => void,moveLocationDown: (locationId: string) => void,@@ -158,7 +158,7 @@ class LocationManager extends React.Component<Props, State> {isDefault: (AppConfig.isWeb && devicePaths[key] === '/files/'), // Used for the web ts demoisReadOnly: false,persistIndex: false- });+ }, false);});}}diff --git a/app/reducers/locations.js b/app/reducers/locations.jsindex 8895c66b9..ce34ea711 100644--- a/app/reducers/locations.js+++ b/app/reducers/locations.js@@ -141,11 +141,13 @@ export default (state: Array<Location> = initialState, action: Object) => {};export const actions = {- addLocation: (location: Location) => (+ addLocation: (location: Location, openAfterCreate?: boolean = true) => (dispatch: (actions: Object) => void) => {dispatch(actions.createLocation(location));- dispatch(AppActions.openLocation(location));+ if (openAfterCreate) {+ dispatch(AppActions.openLocation(location));+ }},createLocation: (location: Location) => ({ type: types.ADD_LOCATION, location }),moveLocationUp: (uuid: string) => ({ type: types.MOVE_UP_LOCATION, uuid }),