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