1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-23 23:33:01 +02:00

Desktop: Resolves #1556: Support selecting multiple notebooks (#13612)

This commit is contained in:
Henry Heino
2025-11-17 14:14:28 -08:00
committed by GitHub
parent bd569b9d8d
commit 00aecd63d4
34 changed files with 866 additions and 318 deletions

View File

@@ -12,13 +12,15 @@ export const declaration: CommandDeclaration = {
export const runtime = (): CommandRuntime => {
return {
execute: async (context: CommandContext, folderId: string = null) => {
if (folderId === null) folderId = context.state.selectedFolderId;
execute: async (context: CommandContext, folderIds: string|string[] = null) => {
if (folderIds === null) folderIds = context.state.selectedFolderIds;
if (!Array.isArray(folderIds)) {
folderIds = [folderIds];
}
const folder = await Folder.load(folderId);
if (!folder) throw new Error(`No such folder: ${folderId}`);
await restoreItems(ModelType.Folder, [folder]);
const folders = await Folder.loadItemsByIdsOrFail(folderIds);
await restoreItems(ModelType.Folder, folders);
},
enabledCondition: 'folderIsDeleted',
enabledCondition: 'foldersAreDeleted',
};
};