Skip to content

Commit 0843c54

Browse files
Improved note renaming
Signed-off-by: Joachim von Eichborn <joachimeichborn@users.noreply.github.com>
1 parent 98d6dc1 commit 0843c54

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/components/Sidebar.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export default {
104104
},
105105
categoryInput: null,
106106
titleEditableInternal: false,
107-
newTtitle: '',
107+
newTitle: '',
108108
}
109109
},
110110
@@ -117,11 +117,18 @@ export default {
117117
return this.titleEditableInternal && !this.note.readonly
118118
},
119119
set(newValue) {
120+
if (newValue) {
121+
this.newTitle = this.title
122+
}
120123
this.titleEditableInternal = newValue
121124
}
122125
},
123126
title() {
124-
return this.note?.title || ''
127+
if (!this.titleEditable) {
128+
return this.note?.title || ''
129+
} else {
130+
return this.newTitle || ''
131+
}
125132
},
126133
category() {
127134
return this.note?.category || ''
@@ -198,10 +205,8 @@ export default {
198205
})
199206
.finally(() => {
200207
this.loading.title = false
201-
this.newTitle = this.title
202208
})
203209
}
204-
this.newTitle = this.title
205210
},
206211
207212
onSaveCategory(category) {

0 commit comments

Comments
 (0)