1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Desktop,Mobile: Fixes #11065: Improve performance when there are many selected items (#11067)

This commit is contained in:
Henry Heino
2024-09-21 04:53:16 -07:00
committed by GitHub
parent 5beb80bf61
commit 0965c6d257
6 changed files with 42 additions and 5 deletions

View File

@ -54,7 +54,7 @@ export default function stateToWhenClauseContext(state: State, options: WhenClau
const selectedNoteIds = state.selectedNoteIds || [];
const selectedNoteId = selectedNoteIds.length === 1 ? selectedNoteIds[0] : null;
const selectedNote: NoteEntity = selectedNoteId ? BaseModel.byId(state.notes, selectedNoteId) : null;
const selectedNotes = selectedNoteIds.map(id => state.notes.find(n => n.id === id)).filter(n => !!n);
const selectedNotes = BaseModel.modelsByIds(state.notes ?? [], selectedNoteIds);
const commandFolderId = options.commandFolderId || state.selectedFolderId;
const commandFolder: FolderEntity = commandFolderId ? BaseModel.byId(state.folders, commandFolderId) : null;