1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Desktop: Fixes #8541: Fix toggle external editing button always disabled in rich text editor (#8595)

This commit is contained in:
Henry Heino 2023-08-01 09:54:39 -07:00 committed by GitHub
parent 28619f1786
commit a138b92b1b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,7 +2,6 @@ import CommandService, { CommandRuntime, CommandDeclaration } from '@joplin/lib/
import { _ } from '@joplin/lib/locale';
import { stateUtils } from '@joplin/lib/reducer';
import { DesktopCommandContext } from '../services/commands/types';
import { enabledCondition } from '../gui/NoteEditor/editorCommandDeclarations';
export const declaration: CommandDeclaration = {
name: 'toggleExternalEditing',
@ -23,7 +22,7 @@ export const runtime = (): CommandRuntime => {
void CommandService.instance().execute('startExternalEditing', noteId);
}
},
enabledCondition: enabledCondition(declaration.name),
enabledCondition: 'oneNoteSelected && !noteIsReadOnly && (!modalDialogVisible || gotoAnythingVisible)',
mapStateToTitle: (state: any) => {
const noteId = stateUtils.selectedNoteId(state);
return state.watchedNoteFiles.includes(noteId) ? _('Stop') : '';