1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Plugins: Hide note list menu items for commands that are disabled (#5270)

This commit is contained in:
Ahmad Mamdouh 2021-08-09 20:04:40 +02:00 committed by GitHub
parent d2e2866995
commit e7260d7498
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -191,9 +191,11 @@ export default class NoteListUtils {
const location = info.view.location;
if (location !== MenuItemLocation.Context && location !== MenuItemLocation.NoteListContextMenu) continue;
menu.append(
new MenuItem(menuUtils.commandToStatefulMenuItem(info.view.commandName, noteIds))
);
if (cmdService.isEnabled(info.view.commandName)) {
menu.append(
new MenuItem(menuUtils.commandToStatefulMenuItem(info.view.commandName, noteIds))
);
}
}
return menu;