chore: lint and fmt
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
import { useTitle } from '@vueuse/core'
|
||||
import { computed, Ref, toValue, watch } from 'vue'
|
||||
import { useTitle } from "@vueuse/core"
|
||||
import { computed, Ref, toValue, watch } from "vue"
|
||||
|
||||
import { useRouteQueryStackedNotes } from '@/hooks/useRouteQueryStackedNotes.hook'
|
||||
import { useNotes } from '@/modules/note/hooks/useNotes'
|
||||
import { pathToNoteTitle } from '@/utils/noteTitle'
|
||||
import { useRouteQueryStackedNotes } from "@/hooks/useRouteQueryStackedNotes.hook"
|
||||
import { useNotes } from "@/modules/note/hooks/useNotes"
|
||||
import { pathToNoteTitle } from "@/utils/noteTitle"
|
||||
|
||||
export const generateTitle = (titles: string[]) => titles.join(' | ')
|
||||
export const generateTitle = (titles: string[]) => titles.join(" | ")
|
||||
|
||||
export const useTitleNotes = (prefix: Ref<string> | string) => {
|
||||
const { stackedNotes } = useRouteQueryStackedNotes()
|
||||
const { notes } = useNotes()
|
||||
const titleNotes = computed(() =>
|
||||
notes.value
|
||||
.filter((note) => stackedNotes.value.includes(note.sha ?? ''))
|
||||
.map((note) => pathToNoteTitle(note.path ?? ''))
|
||||
.filter((note) => stackedNotes.value.includes(note.sha ?? ""))
|
||||
.map((note) => pathToNoteTitle(note.path ?? ""))
|
||||
)
|
||||
|
||||
const title = useTitle(generateTitle([toValue(prefix), ...titleNotes.value]))
|
||||
|
||||
Reference in New Issue
Block a user