fix: no : in class names
This commit is contained in:
@@ -18,6 +18,7 @@ const props = defineProps<{
|
|||||||
const didrkey = computed(() => props.didrkey)
|
const didrkey = computed(() => props.didrkey)
|
||||||
const did = computed(() => props.didrkey.split("-")[0])
|
const did = computed(() => props.didrkey.split("-")[0])
|
||||||
const rkey = computed(() => props.didrkey.split("-")[1])
|
const rkey = computed(() => props.didrkey.split("-")[1])
|
||||||
|
const classNameId = computed(() => didrkey.value.replaceAll(":", "-"))
|
||||||
|
|
||||||
const index = computed(() => props.index)
|
const index = computed(() => props.index)
|
||||||
|
|
||||||
@@ -67,12 +68,12 @@ watch(
|
|||||||
:class="{
|
:class="{
|
||||||
[className]: true,
|
[className]: true,
|
||||||
overlay: displayNoteOverlay,
|
overlay: displayNoteOverlay,
|
||||||
[`note-${didrkey}`]: true,
|
[`note-${classNameId}`]: true,
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<a
|
<a
|
||||||
class="title-stacked-note-link"
|
class="title-stacked-note-link"
|
||||||
@click.prevent="scrollToFocusedNote(didrkey)"
|
@click.prevent="scrollToFocusedNote(classNameId)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
class="title-stacked-note breadcrumbs text-sm"
|
class="title-stacked-note breadcrumbs text-sm"
|
||||||
|
|||||||
@@ -29,8 +29,9 @@ export const useRouteQueryStackedNotes = () => {
|
|||||||
|
|
||||||
if (isMobile.value) {
|
if (isMobile.value) {
|
||||||
if (noteId) {
|
if (noteId) {
|
||||||
|
const cleanNoteId = noteId.replaceAll(":", "-")
|
||||||
const element = document.querySelector(
|
const element = document.querySelector(
|
||||||
`.note-${noteId}`,
|
`.note-${cleanNoteId}`,
|
||||||
) as HTMLElement
|
) as HTMLElement
|
||||||
|
|
||||||
const top = (index + 1) * (element?.clientHeight ?? height.value)
|
const top = (index + 1) * (element?.clientHeight ?? height.value)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export const getAuthor = async (did: string): Promise<Author | null> => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { data: author, error } = await microcosmSlingshot(
|
const { data: author } = await microcosmSlingshot(
|
||||||
"/xrpc/blue.microcosm.identity.resolveMiniDoc",
|
"/xrpc/blue.microcosm.identity.resolveMiniDoc",
|
||||||
{ query: { identifier: did } },
|
{ query: { identifier: did } },
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,21 +1,5 @@
|
|||||||
import { getAuthor } from "@/modules/atproto/getAuthor"
|
import { getAuthor } from "@/modules/atproto/getAuthor"
|
||||||
|
|
||||||
const endpointCache = new Map<string, string>()
|
|
||||||
|
|
||||||
const getEndpoint = async (did: string) => {
|
|
||||||
if (endpointCache.has(did)) {
|
|
||||||
return endpointCache.get(did)
|
|
||||||
}
|
|
||||||
const response = await fetch(`https://plc.directory/${did}`)
|
|
||||||
const {
|
|
||||||
service: [{ serviceEndpoint }],
|
|
||||||
} = await response.json()
|
|
||||||
|
|
||||||
endpointCache.set(did, serviceEndpoint)
|
|
||||||
|
|
||||||
return serviceEndpoint as string
|
|
||||||
}
|
|
||||||
|
|
||||||
export const getUrl = async ({ did, rkey }: { did: string; rkey: string }) => {
|
export const getUrl = async ({ did, rkey }: { did: string; rkey: string }) => {
|
||||||
const author = await getAuthor(did)
|
const author = await getAuthor(did)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user