fixes overwriting attributes after clicking on a relation in the attribute editor, closes #3090

This commit is contained in:
zadam 2022-08-26 22:02:40 +02:00
parent df351a8d09
commit 35fab7a23c

View File

@ -297,6 +297,12 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
}
async save() {
if (this.lastUpdatedNoteId !== this.noteId) {
// https://github.com/zadam/trilium/issues/3090
console.warn("Ignoring blur event because a different note is loaded.");
return;
}
const attributes = this.parseAttributes();
if (attributes) {
@ -354,6 +360,8 @@ export default class AttributeEditorWidget extends NoteContextAwareWidget {
}
dataChanged() {
this.lastUpdatedNoteId = this.noteId;
if (this.lastSavedContent === this.textEditor.getData()) {
this.$saveAttributesButton.fadeOut();
}