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

Desktop: Improved menu enabled states when not in main screen

This commit is contained in:
Laurent Cozic
2020-09-21 17:09:57 +01:00
parent 3ac4fbeee5
commit 7a4c97618d
4 changed files with 13 additions and 5 deletions

View File

@ -27,10 +27,14 @@ export const runtime = ():CommandRuntime => {
// await comp.saveNoteAndWait(comp.formNote);
},
isEnabled: (props:any) => {
if (props.routeName !== 'Main') return false;
return !!props.noteId;
},
mapStateToProps: (state:any) => {
return { noteId: state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null };
return {
noteId: state.selectedNoteIds.length === 1 ? state.selectedNoteIds[0] : null,
routeName: state.route.routeName,
};
},
};
};