mirror of
https://github.com/laurent22/joplin.git
synced 2026-10-25 02:47:28 +00:00
Desktop: Fixes #16229: Deselect conflicts or trashed notes when switching to the all notes notebook (#16590)
This commit is contained in:
1 parent
c81243852d
commit
56ea34fbe4
2 files changed
+24
-2
No files matched your search
@@ -54,6 +54,7 @@ import SyncTargetJoplinCloud from './SyncTargetJoplinCloud';
|
||||
import { setAutoFreeze } from 'immer';
|
||||
import { getEncryptionEnabled } from './services/synchronizer/syncInfoUtils';
|
||||
import { loadMasterKeysFromSettings, migrateMasterPassword, migratePpk } from './services/e2ee/utils';
|
||||
import { ALL_NOTES_FILTER_ID } from './reserved-ids';
|
||||
import SyncTargetNone from './SyncTargetNone';
|
||||
import { setRSA } from './services/e2ee/ppk/ppk';
|
||||
import RSA from './services/e2ee/ppk/RSA.node';
|
||||
@@ -93,6 +94,13 @@ export interface StartOptions {
|
||||
}
|
||||
export const safeModeFlagFilename = 'force-safe-mode-on-next-start';
|
||||
|
||||
export const shouldPreserveSelectedNoteOnSmartFilterSelect = (state: State, smartFilterId: string) => {
|
||||
if (smartFilterId !== ALL_NOTES_FILTER_ID) return true;
|
||||
|
||||
const selectedNote = stateUtils.selectedNote(state);
|
||||
return !!selectedNote && !selectedNote.deleted_time && !selectedNote.is_conflict;
|
||||
};
|
||||
|
||||
export default class BaseApplication {
|
||||
|
||||
private eventEmitter_: EventEmitter;
|
||||
@@ -552,7 +560,7 @@ export default class BaseApplication {
|
||||
|
||||
if (action.type === 'SMART_FILTER_SELECT') {
|
||||
refreshNotes = true;
|
||||
refreshNotesUseSelectedNoteId = true;
|
||||
refreshNotesUseSelectedNoteId = shouldPreserveSelectedNoteOnSmartFilterSelect(newState, action.id);
|
||||
}
|
||||
|
||||
// Switching windows can also change which note(s) and which note parent type is selected.
|
||||
|
||||
Reference in new issue
Block a user