(note) init image display

This commit is contained in:
2021-03-22 22:27:11 +01:00
parent cb5ff68866
commit d4391bb8c6
7 changed files with 106 additions and 28 deletions

View File

@@ -9,13 +9,16 @@ let initial = true
export const useQueryStackedNotes = () => {
const { query } = useRoute()
const setStackedNotes = () => {
stackedNotes.value = (Array.isArray(query.stackedNotes)
const initResetStackedNote = () =>
(Array.isArray(query.stackedNotes)
? query.stackedNotes
: [query.stackedNotes]
)
.map((n) => n?.toString())
.filter((n) => !!n) as string[]
const setStackedNotes = () => {
stackedNotes.value = initResetStackedNote()
}
if (initial) {
@@ -27,6 +30,6 @@ export const useQueryStackedNotes = () => {
stackedNotes: readonly(stackedNotes),
updateQueryStackedNotes: (newStackedNotes: string[]) =>
(stackedNotes.value = newStackedNotes),
resetStackedNotes: () => (stackedNotes.value = [])
resetStackedNotes: () => initResetStackedNote()
}
}