reset stacked note on click

This commit is contained in:
Julien Calixte
2023-08-14 18:57:17 +02:00
parent 6412b1252c
commit 780eaeb7f7
3 changed files with 8 additions and 9 deletions

View File

@@ -100,14 +100,14 @@ const focusREADME = () => scrollToTop()
</div>
<div class="repo-title">
<h1 class="title is-1">
[<router-link
<router-link
:to="{ name: 'FluxNoteView', params: { user, repo } }"
@click="resetStackedNotes"
>
{{ repo }} </router-link
>]
{{ repo }}
</router-link>
</h1>
<h4 class="subtitle is-4">
<h4 class="subtitle is-5">
<em>{{ user }}</em> -
<img
v-show="store.isReadmeOffline"

View File

@@ -35,7 +35,7 @@ export const useQueryStackedNotes = () => {
})
}
const initResetStackedNote = () => {
const resetStackedNotes = () => {
stackedNotes.value = Array.isArray(query.stackedNotes)
? (query.stackedNotes as string[])
: ([query.stackedNotes]
@@ -45,7 +45,7 @@ export const useQueryStackedNotes = () => {
if (initial) {
initial = false
initResetStackedNote()
resetStackedNotes()
}
const updateQueryStackedNotes = (newStackedNotes: string[]) =>
@@ -98,7 +98,7 @@ export const useQueryStackedNotes = () => {
stackedNotes: readonly(stackedNotes),
updateQueryStackedNotes,
addStackedNote,
resetStackedNotes: () => initResetStackedNote(),
resetStackedNotes,
scrollToFocusedNote,
scrollToTop: () => scrollToNote(0)
}

View File

@@ -52,8 +52,7 @@ export const useUserRepoStore = defineStore({
this.files = files
// if the offline state is too quick,
// it gives more the impression of
// glitch.
// it gives more the impression of glitch.
setTimeout(() => {
this.isReadmeOffline = false
}, 500)