Skip to content

Commit

Permalink
Revert "Ensure root knows when note title changes. Fixes dullage#82."
Browse files Browse the repository at this point in the history
This reverts commit 851c640.
  • Loading branch information
Gedulis12 committed Aug 7, 2023
1 parent 7187e4e commit ea20e90
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
9 changes: 2 additions & 7 deletions flatnotes/src/components/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 () {
Expand All @@ -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();
Expand Down
8 changes: 3 additions & 5 deletions flatnotes/src/components/NoteViewerEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,7 @@ export default {
watch: {
titleToLoad: function () {
if (this.titleToLoad !== this.currentNote?.title) {
this.init();
}
this.init();
},
},
Expand All @@ -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) {
Expand Down Expand Up @@ -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();
Expand Down

0 comments on commit ea20e90

Please sign in to comment.