fix: prevent stacking a duplicate of the main note when clicking a self-link

This commit is contained in:
Julien Calixte
2026-03-21 22:59:10 +01:00
parent c0b1a33c69
commit 32f79785a8
3 changed files with 30 additions and 4 deletions

View File

@@ -1,5 +1,6 @@
<script lang="ts" setup>
import { computed, nextTick, ref, watch } from "vue"
import { useRoute } from "vue-router"
import { errorMessage } from "@/utils/notif"
import { useATProtoLinks } from "@/hooks/useATProtoLinks.hook"
import { useNoteOverlay } from "@/hooks/useNoteOverlay.hook"
@@ -33,8 +34,16 @@ const url = computedAsync(async () =>
const className = computed(() => `stacked-note-${props.index}`)
const titleClassName = computed(() => `title-${className.value}`)
const route = useRoute()
const mainNoteId = computed(
() => `${route.params.shortDid}-${route.params.rkey}`,
)
const { scrollToFocusedNote } = useRouteQueryStackedNotes()
const { listenToClick } = useATProtoLinks(className.value, didrkey)
const { listenToClick } = useATProtoLinks(className.value, {
currentAtUri: didrkey,
mainNoteId,
})
const { displayNoteOverlay } = useNoteOverlay(className.value, index)
const noteNotFound = ref(false)