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

View File

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

View File

@@ -1,6 +1,6 @@
<template>
<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">
Drafts
</h3>

View File

@@ -1,6 +1,11 @@
<template>
<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">
Fleeting notes
</h3>