🐛 (backlinks) does not display backlinks if user setting is set to false

This commit is contained in:
Julien Calixte
2023-07-17 23:55:55 +02:00
parent 7ef6205109
commit 1ca4730096

View File

@@ -6,6 +6,7 @@ import { useLinks } from '@/hooks/useLinks.hook'
import { useNoteOverlay } from '@/hooks/useNoteOverlay.hook' import { useNoteOverlay } from '@/hooks/useNoteOverlay.hook'
import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook' import { useQueryStackedNotes } from '@/hooks/useQueryStackedNotes.hook'
import { useTitleNotes } from '@/hooks/useTitleNotes.hook' import { useTitleNotes } from '@/hooks/useTitleNotes.hook'
import { useUserRepoStore } from '@/modules/repo/store/userRepo.store'
import { filenameToNoteTitle } from '@/utils/noteTitle' import { filenameToNoteTitle } from '@/utils/noteTitle'
import { generateTweets } from '@/utils/twitter' import { generateTweets } from '@/utils/twitter'
import { computed, nextTick, watch } from 'vue' import { computed, nextTick, watch } from 'vue'
@@ -25,6 +26,9 @@ const className = computed(() => `stacked-note-${props.index}`)
const titleClassName = computed(() => `title-${className.value}`) const titleClassName = computed(() => `title-${className.value}`)
useTitleNotes(props.repo) useTitleNotes(props.repo)
const store = useUserRepoStore()
const hasBacklinks = computed(() => store.userSettings?.backlink)
const { displayNoteOverlay } = useNoteOverlay(className.value, props.index) const { displayNoteOverlay } = useNoteOverlay(className.value, props.index)
const displayedTitle = computed(() => filenameToNoteTitle(props.title)) const displayedTitle = computed(() => filenameToNoteTitle(props.title))
@@ -64,7 +68,7 @@ const focus = () => scrollToFocusedNote(props.sha)
</router-link> </router-link>
</div> </div>
<section class="note-content" v-html="content"></section> <section class="note-content" v-html="content"></section>
<linked-notes v-if="content" :sha="sha" /> <linked-notes v-if="hasBacklinks && content" :sha="sha" />
</div> </div>
</template> </template>