This commit is contained in:
@@ -26,7 +26,9 @@ function markDirty() {
|
||||
}
|
||||
|
||||
function closeNote(){
|
||||
emitter.emit('delete-note', props.noteKey);
|
||||
// 'close-note' only closes the opened note; 'delete-note' is reserved for
|
||||
// actual deletions (sidebar removal happens on that event instead)
|
||||
emitter.emit('close-note', props.noteKey);
|
||||
}
|
||||
|
||||
const compiledMarkdown = computed(() => {
|
||||
|
||||
@@ -47,6 +47,7 @@ function handleDeleteNote(key) {
|
||||
// Moure aixo
|
||||
onMounted(() => {
|
||||
emitter.on("push-note", handlePushNote);
|
||||
emitter.on("close-note", handleDeleteNote);
|
||||
emitter.on("delete-note", handleDeleteNote);
|
||||
emitter.on("title-updated", handleTitleUpdated);
|
||||
});
|
||||
@@ -60,6 +61,7 @@ function handleTitleUpdated(data) {
|
||||
|
||||
onUnmounted(() => {
|
||||
emitter.off("push-note", handlePushNote);
|
||||
emitter.off("close-note", handleDeleteNote);
|
||||
emitter.off("delete-note", handleDeleteNote);
|
||||
emitter.off("title-updated", handleTitleUpdated);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user