diff --git a/flatnotes/src/components/App.js b/flatnotes/src/components/App.js index a6b766d..55d5647 100644 --- a/flatnotes/src/components/App.js +++ b/flatnotes/src/components/App.js @@ -100,8 +100,8 @@ export default { // Note else if (basePath == constants.basePaths.note) { + this.updateDocumentTitle(); this.noteTitle = decodeURIComponent(path[2]); - this.updateDocumentTitle(this.noteTitle); this.currentView = this.views.note; } @@ -172,11 +172,6 @@ export default { this.darkTheme = !this.darkTheme; localStorage.setItem("darkTheme", this.darkTheme); }, - - updateNoteTitle: function (title) { - this.noteTitle = title; - this.updateDocumentTitle(title); - }, }, created: function () { @@ -186,7 +181,7 @@ export default { EventBus.$on("navigate", this.navigate); EventBus.$on("unhandledServerError", this.unhandledServerErrorToast); - EventBus.$on("updateNoteTitle", this.updateNoteTitle); + EventBus.$on("updateDocumentTitle", this.updateDocumentTitle); Mousetrap.bind("/", function () { parent.openSearch(); diff --git a/flatnotes/src/components/NoteViewerEditor.vue b/flatnotes/src/components/NoteViewerEditor.vue index b1a42e4..344f03f 100644 --- a/flatnotes/src/components/NoteViewerEditor.vue +++ b/flatnotes/src/components/NoteViewerEditor.vue @@ -209,9 +209,7 @@ export default { watch: { titleToLoad: function () { - if (this.titleToLoad !== this.currentNote?.title) { - this.init(); - } + this.init(); }, }, @@ -227,7 +225,7 @@ export default { response.data.lastModified, response.data.content ); - // EventBus.$emit("updateDocumentTitle", parent.currentNote.title); + EventBus.$emit("updateDocumentTitle", parent.currentNote.title); }) .catch(function (error) { if (error.handled) { @@ -448,7 +446,7 @@ export default { response.data.lastModified, response.data.content ); - EventBus.$emit("updateNoteTitle", this.currentNote.title); + EventBus.$emit("updateDocumentTitle", this.currentNote.title); history.replaceState(null, "", this.currentNote.href); this.setEditMode(false); this.noteSavedToast();