refacto to use ref route query
This commit is contained in:
@@ -14,7 +14,7 @@ import StackedNote from '@/components/StackedNote.vue'
|
||||
import { useLinks } from '@/hooks/useLinks.hook'
|
||||
import { useMarkdown } from '@/hooks/useMarkdown.hook'
|
||||
import { useNote } from '@/hooks/useNote.hook'
|
||||
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
|
||||
import { useRouteQueryStackedNotes } from '@/hooks/useRouteQueryStackedNotes.hook'
|
||||
import { useVisitRepo } from '@/modules/history/hooks/useVisitRepo.hook'
|
||||
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
|
||||
import { useUserSettings } from '@/modules/user/hooks/useUserSettings.hook'
|
||||
@@ -49,7 +49,7 @@ useUserSettings()
|
||||
const { visitRepo } = useVisitRepo({ user: user, repo: repo })
|
||||
const { toHTML } = useMarkdown(repo)
|
||||
const { listenToClick } = useLinks('note-display')
|
||||
const { stackedNotes, resetStackedNotes, scrollToTop } = useQueryStackedNotes()
|
||||
const { stackedNotes, scrollToTop } = useRouteQueryStackedNotes()
|
||||
|
||||
const { titles } = useNote('note-container')
|
||||
|
||||
@@ -85,7 +85,6 @@ onMounted(() => visitRepo())
|
||||
|
||||
onUnmounted(() => {
|
||||
store.resetFiles()
|
||||
resetStackedNotes()
|
||||
})
|
||||
|
||||
const focusREADME = () => scrollToTop()
|
||||
@@ -100,10 +99,7 @@ const focusREADME = () => scrollToTop()
|
||||
</div>
|
||||
<div class="repo-title">
|
||||
<h1 class="title is-1">
|
||||
<router-link
|
||||
:to="{ name: 'FluxNoteView', params: { user, repo } }"
|
||||
@click="resetStackedNotes"
|
||||
>
|
||||
<router-link :to="{ name: 'FluxNoteView', params: { user, repo } }">
|
||||
{{ repo }}
|
||||
</router-link>
|
||||
</h1>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { useBacklinks } from '@/hooks/useBacklinks.hook'
|
||||
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
|
||||
import { useRouteQueryStackedNotes } from '@/hooks/useRouteQueryStackedNotes.hook'
|
||||
|
||||
const props = defineProps<{
|
||||
sha: string
|
||||
@@ -11,7 +11,7 @@ const props = defineProps<{
|
||||
const shaProp = computed((props) => props.sha)
|
||||
|
||||
const { backlink } = useBacklinks(shaProp)
|
||||
const { addStackedNote } = useQueryStackedNotes()
|
||||
const { addStackedNote } = useRouteQueryStackedNotes()
|
||||
const hasBacklinks = computed(() => (backlink.value?.links.length ?? 0) > 0)
|
||||
|
||||
const emitNote = (sha: string) => {
|
||||
|
||||
@@ -5,7 +5,7 @@ import { useFile } from '@/hooks/useFile.hook'
|
||||
import { useImages } from '@/hooks/useImages.hook'
|
||||
import { useLinks } from '@/hooks/useLinks.hook'
|
||||
import { useNoteOverlay } from '@/hooks/useNoteOverlay.hook'
|
||||
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
|
||||
import { useRouteQueryStackedNotes } from '@/hooks/useRouteQueryStackedNotes.hook'
|
||||
import { useTitleNotes } from '@/hooks/useTitleNotes.hook'
|
||||
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
|
||||
import { filenameToNoteTitle } from '@/utils/noteTitle'
|
||||
@@ -27,7 +27,7 @@ const sha = computed(() => props.sha)
|
||||
const index = computed(() => props.index)
|
||||
const repo = computed(() => props.repo)
|
||||
|
||||
const { scrollToFocusedNote } = useQueryStackedNotes()
|
||||
const { scrollToFocusedNote } = useRouteQueryStackedNotes()
|
||||
|
||||
const { content } = useFile(sha)
|
||||
const className = computed(() => `stacked-note-${props.index}`)
|
||||
|
||||
Reference in New Issue
Block a user