fix: reset isTemplateNote when setting a new note (#439)
* fix: reset isTemplateNote when setting a new note * refactor: simplify code * refecator: use default argument
This commit is contained in:
@@ -68,8 +68,7 @@ export class Editor {
|
|||||||
references: []
|
references: []
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
this.isTemplateNote = true;
|
this.setNote(note as SNNote, true);
|
||||||
this.setNote(note as SNNote);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,8 +96,9 @@ export class Editor {
|
|||||||
/**
|
/**
|
||||||
* Sets the editor contents by setting its note.
|
* Sets the editor contents by setting its note.
|
||||||
*/
|
*/
|
||||||
public setNote(note: SNNote) {
|
public setNote(note: SNNote, isTemplate = false) {
|
||||||
this.note = note;
|
this.note = note;
|
||||||
|
this.isTemplateNote = isTemplate;
|
||||||
if (this._onNoteChange) {
|
if (this._onNoteChange) {
|
||||||
this._onNoteChange();
|
this._onNoteChange();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user