Skip to content

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

fix: Unable to select files in the perspective while file in edit mode (#1549)

Stanimir0790078c4d32
diff --git a/app/reducers/app.ts b/app/reducers/app.ts
index e62cbe86a..80d9f3f40 100644
--- a/app/reducers/app.ts
+++ b/app/reducers/app.ts
@@ -1104,11 +1104,11 @@ export const actions = {
dispatch: (actions: Object) => void,
getState: () => any
) => {
- const { openedFiles } = getState().app;
+ // const { openedFiles } = getState().app;
// skip select other file if its have openedFiles in editMode
- if (openedFiles.length === 0 || !openedFiles[0].editMode) {
- dispatch(actions.setSelectedEntriesInt(selectedEntries));
- }
+ // if (openedFiles.length === 0 || !openedFiles[0].editMode) {
+ dispatch(actions.setSelectedEntriesInt(selectedEntries));
+ // }
},
setSelectedEntriesInt: (selectedEntries: Array<Object>) => ({
type: types.SET_SELECTED_ENTRIES,
@@ -1622,9 +1622,21 @@ export const actions = {
if (openedFiles.length > 0) {
const openFile = openedFiles[0];
if (openFile.editMode) {
- // && openFile.changed) {
- entryForOpening = { ...openFile, shouldReload: !openFile.shouldReload }; // false };
+ entryForOpening = {
+ ...openFile,
+ shouldReload:
+ openFile.shouldReload !== undefined
+ ? !openFile.shouldReload
+ : undefined
+ }; // false };
dispatch(actions.addToEntryContainer(entryForOpening));
+ dispatch(
+ actions.showNotification(
+ `You can't open another file, because '${openFile.path}' is opened for editing`,
+ 'default',
+ true
+ )
+ );
return false;
}
}