feat: aka without the at://
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<router-link v-if="isLogged" :to="{ name: 'RepoList' }" class="btn"
|
||||
>Manage your repos</router-link
|
||||
>
|
||||
<router-link :to="{ name: 'PublicNoteList' }" class="btn"
|
||||
<router-link :to="{ name: 'PublicNoteListView' }" class="btn"
|
||||
>Public notes</router-link
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,22 @@
|
||||
const correspondanceCache = new Map<string, string>()
|
||||
|
||||
export const getAka = async (dids: Set<string>) => {
|
||||
const correspondance = await Promise.all(
|
||||
[...dids].map(async (did) => {
|
||||
if (correspondanceCache.has(did)) {
|
||||
return [did, correspondanceCache.get(did)!] as [string, string]
|
||||
}
|
||||
|
||||
const response = await fetch(`https://plc.directory/${did}`)
|
||||
const {
|
||||
alsoKnownAs: [aka],
|
||||
} = await response.json()
|
||||
return [did, aka] as [string, string]
|
||||
|
||||
const alias = aka.replace("at://", "")
|
||||
|
||||
correspondanceCache.set(did, alias)
|
||||
|
||||
return [did, alias] as [string, string]
|
||||
}),
|
||||
)
|
||||
|
||||
|
||||
@@ -8,11 +8,6 @@ const routes: Array<RouteRecordRaw> = [
|
||||
name: "RepoList",
|
||||
component: () => import("@/views/RepoList.vue"),
|
||||
},
|
||||
{
|
||||
path: "/notes",
|
||||
name: "PublicNoteList",
|
||||
component: () => import("@/views/PublicNoteList.vue"),
|
||||
},
|
||||
{
|
||||
path: "/:user/:repo",
|
||||
name: "FluxNoteView",
|
||||
@@ -21,13 +16,13 @@ const routes: Array<RouteRecordRaw> = [
|
||||
},
|
||||
{
|
||||
path: "/notes",
|
||||
name: "PublicNoteView",
|
||||
component: () => import("@/views/PublicNoteView.vue"),
|
||||
name: "PublicNoteListView",
|
||||
component: () => import("@/views/PublicNoteListView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/tiboudenote",
|
||||
name: "PublicNoteView",
|
||||
component: () => import("@/views/PublicNoteView.vue"),
|
||||
name: "PublicNoteListView",
|
||||
component: () => import("@/views/PublicNoteListView.vue"),
|
||||
},
|
||||
{
|
||||
path: "/:user/:repo/inbox",
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { noteRouter } from "@/modules/post/data/client"
|
||||
|
||||
const { data: notes, isLoading } = noteRouter.noteLists.get.useQuery(["notes"])
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="public-note-view" v-if="isLoading">
|
||||
<ul>
|
||||
<li v-for="note in notes">{{ note.did }} / {{ note.rkey }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.public-note-view {
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user