// Note
else if (basePath == constants.basePaths.note) {
- this.updateDocumentTitle();
this.noteTitle = decodeURIComponent(path[2]);
+ this.updateDocumentTitle(this.noteTitle);
this.currentView = this.views.note;
}
this.darkTheme = !this.darkTheme;
localStorage.setItem("darkTheme", this.darkTheme);
},
+
+ updateNoteTitle: function (title) {
+ this.noteTitle = title;
+ this.updateDocumentTitle(title);
+ },
},
created: function () {
EventBus.$on("navigate", this.navigate);
EventBus.$on("unhandledServerError", this.unhandledServerErrorToast);
- EventBus.$on("updateDocumentTitle", this.updateDocumentTitle);
+ EventBus.$on("updateNoteTitle", this.updateNoteTitle);
Mousetrap.bind("/", function () {
parent.openSearch();
watch: {
titleToLoad: function () {
- this.init();
+ if (this.titleToLoad !== this.currentNote?.title) {
+ this.init();
+ }
},
},
response.data.lastModified,
response.data.content
);
- EventBus.$emit("updateDocumentTitle", parent.currentNote.title);
+ // EventBus.$emit("updateDocumentTitle", parent.currentNote.title);
})
.catch(function (error) {
if (error.handled) {
response.data.lastModified,
response.data.content
);
- EventBus.$emit("updateDocumentTitle", this.currentNote.title);
+ EventBus.$emit("updateNoteTitle", this.currentNote.title);
history.replaceState(null, "", this.currentNote.href);
this.setEditMode(false);
this.noteSavedToast();