🐛 (flux note) update query strings on fleeting notes

This commit is contained in:
2021-03-22 23:13:56 +01:00
parent eb6bb9e0fa
commit 165cfb96e7
4 changed files with 16 additions and 10 deletions

View File

@@ -41,7 +41,8 @@ import {
toRefs, toRefs,
computed, computed,
watch, watch,
nextTick nextTick,
onUnmounted
} from 'vue' } from 'vue'
import HeaderNote from '@/components/HeaderNote.vue' import HeaderNote from '@/components/HeaderNote.vue'
import { useNote } from '@/hooks/useNote.hook' import { useNote } from '@/hooks/useNote.hook'
@@ -83,6 +84,10 @@ export default defineComponent({
watch(renderedContent, () => nextTick(() => listenToClick())) watch(renderedContent, () => nextTick(() => listenToClick()))
onUnmounted(() => {
readme.value = ''
})
return { return {
hasContent, hasContent,
renderedContent, renderedContent,

View File

@@ -10,20 +10,16 @@ export const useQueryStackedNotes = () => {
const { query } = useRoute() const { query } = useRoute()
const initResetStackedNote = () => const initResetStackedNote = () =>
(Array.isArray(query.stackedNotes) (stackedNotes.value = (Array.isArray(query.stackedNotes)
? query.stackedNotes ? query.stackedNotes
: [query.stackedNotes] : [query.stackedNotes]
) )
.map((n) => n?.toString()) .map((n) => n?.toString())
.filter((n) => !!n) as string[] .filter((n) => !!n) as string[])
const setStackedNotes = () => {
stackedNotes.value = initResetStackedNote()
}
if (initial) { if (initial) {
initial = false initial = false
setStackedNotes() initResetStackedNote()
} }
return { return {

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="draft-notes"> <div class="draft-notes">
<flux-note :user="user" :repo="repo" :content="content"> <flux-note :user="user" :repo="repo" :content="content" key="draft-notes">
<h3 class="subtitle is-3"> <h3 class="subtitle is-3">
Drafts Drafts
</h3> </h3>

View File

@@ -1,6 +1,11 @@
<template> <template>
<div class="fleeting-notes"> <div class="fleeting-notes">
<flux-note :user="user" :repo="repo" :content="content"> <flux-note
:user="user"
:repo="repo"
:content="content"
key="fleeting-notes"
>
<h3 class="subtitle is-3"> <h3 class="subtitle is-3">
Fleeting notes Fleeting notes
</h3> </h3>