Component view refactor (#770)
* refactor: simplify component-view lifecycle callbacks * fix: reintroduce exhaustive-deps
This commit is contained in:
@@ -174,7 +174,8 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
||||
this.editorValues.text = note.text;
|
||||
}
|
||||
|
||||
const isTemplateNoteInsertedToBeInteractableWithEditor = source === PayloadSource.Constructor && note.dirty;
|
||||
const isTemplateNoteInsertedToBeInteractableWithEditor =
|
||||
source === PayloadSource.Constructor && note.dirty;
|
||||
if (isTemplateNoteInsertedToBeInteractableWithEditor) {
|
||||
return;
|
||||
}
|
||||
@@ -396,7 +397,7 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
||||
this.reloadFont();
|
||||
} else if (component.area === ComponentArea.Editor) {
|
||||
const currentEditor = this.state.editorComponent;
|
||||
if (currentEditor && component !== currentEditor) {
|
||||
if (currentEditor && component.uuid !== currentEditor.uuid) {
|
||||
await this.disassociateComponentWithCurrentNote(currentEditor);
|
||||
}
|
||||
const prefersPlain = this.note.prefersPlainEditor;
|
||||
|
||||
Reference in New Issue
Block a user