fix(popup_editor): classic editor toolbar displayed when it shouldn't

This commit is contained in:
Elian Doran 2025-07-10 16:37:34 +03:00
parent b595d1fade
commit 63dc5697dd
No known key found for this signature in database

View file

@ -48,6 +48,18 @@ export default class ClassicEditorToolbar extends NoteContextAwareWidget {
this.contentSized();
}
isEnabled(): boolean | null | undefined {
if (options.get("textNoteEditorType") !== "ckeditor-classic") {
return false;
}
if (!this.note || this.note.type !== "text") {
return false;
}
return true;
}
async getTitle() {
return {
show: await this.#shouldDisplay(),
@ -58,11 +70,7 @@ export default class ClassicEditorToolbar extends NoteContextAwareWidget {
}
async #shouldDisplay() {
if (options.get("textNoteEditorType") !== "ckeditor-classic") {
return false;
}
if (!this.note || this.note.type !== "text") {
if (!this.isEnabled()) {
return false;
}