diff --git a/bun.lockb b/bun.lockb index e8e527d..76ed761 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/components/social-elements/notifications/notif.vue b/components/social-elements/notifications/notif.vue index 5659424..32c3b75 100644 --- a/components/social-elements/notifications/notif.vue +++ b/components/social-elements/notifications/notif.vue @@ -19,8 +19,10 @@
- Accept - Reject + Accept + + Reject +
@@ -47,7 +49,7 @@ const acceptFollowRequest = async () => { const { data } = await client.value.acceptFollowRequest( props.notification.account.id, ); - relationship.value = data as Relationship; + relationship.value = data; isWorkingOnFollowRequest.value = false; }; @@ -57,7 +59,7 @@ const rejectFollowRequest = async () => { const { data } = await client.value.rejectFollowRequest( props.notification.account.id, ); - relationship.value = data as Relationship; + relationship.value = data; isWorkingOnFollowRequest.value = false; }; diff --git a/composables/Identities.ts b/composables/Identities.ts index b52a86f..7a09d7b 100644 --- a/composables/Identities.ts +++ b/composables/Identities.ts @@ -106,7 +106,7 @@ export const useCurrentIdentity = (): Ref => { ); if (identities.value.length > 0) { - currentId.value = identities.value[0].id; + currentId.value = identities.value[0]?.id; } else { currentId.value = null; } diff --git a/composables/Note.ts b/composables/Note.ts index 51c8bf7..5a45a62 100644 --- a/composables/Note.ts +++ b/composables/Note.ts @@ -14,7 +14,7 @@ export const useNote = ( ref(client) .value?.getStatus(noteId) .then((res) => { - output.value = res.data as Status; + output.value = res.data; }); return output; diff --git a/composables/NoteContext.ts b/composables/NoteContext.ts index 05eb941..f707c9c 100644 --- a/composables/NoteContext.ts +++ b/composables/NoteContext.ts @@ -16,7 +16,7 @@ export const useNoteContext = ( ref(client) .value?.getStatusContext(toValue(noteId) ?? "") .then((res) => { - output.value = res.data as Context; + output.value = res.data; }); }); diff --git a/composables/NoteData.ts b/composables/NoteData.ts index 96f7855..9c5500e 100644 --- a/composables/NoteData.ts +++ b/composables/NoteData.ts @@ -58,7 +58,7 @@ export const useNoteData = ( ); if (result?.data) { - useEvent("note:delete", result.data as Status); + useEvent("note:delete", result.data); } }; diff --git a/composables/Relationship.ts b/composables/Relationship.ts index 16b2b3d..fac23f8 100644 --- a/composables/Relationship.ts +++ b/composables/Relationship.ts @@ -18,7 +18,7 @@ export const useRelationship = ( toValue(client) ?.getRelationship(toValue(accountId) ?? "") .then((res) => { - relationship.value = res.data as Relationship; + relationship.value = res.data; }); }); diff --git a/composables/Timeline.ts b/composables/Timeline.ts index dee060e..ba087af 100644 --- a/composables/Timeline.ts +++ b/composables/Timeline.ts @@ -49,7 +49,7 @@ export const useTimeline = < ); if (newNotes.length > 0) { fetchedNotes.value = [...fetchedNotes.value, ...newNotes]; - nextMaxId = newNotes[newNotes.length - 1].id; + nextMaxId = newNotes[newNotes.length - 1]?.id; for (const note of newNotes) { fetchedNoteIds.add(note.id); } @@ -70,7 +70,7 @@ export const useTimeline = < ); if (newNotes.length > 0) { fetchedNotes.value = [...newNotes, ...fetchedNotes.value]; - prevMinId = newNotes[0].id; + prevMinId = newNotes[0]?.id; for (const note of newNotes) { fetchedNoteIds.add(note.id); } @@ -132,7 +132,7 @@ export const useIdTimeline = < ); if (newNotes.length > 0) { fetchedNotes.value = [...fetchedNotes.value, ...newNotes]; - nextMaxId = newNotes[newNotes.length - 1].id; + nextMaxId = newNotes[newNotes.length - 1]?.id; for (const note of newNotes) { fetchedNoteIds.add(note.id); } @@ -153,7 +153,7 @@ export const useIdTimeline = < ); if (newNotes.length > 0) { fetchedNotes.value = [...newNotes, ...fetchedNotes.value]; - prevMinId = newNotes[0].id; + prevMinId = newNotes[0]?.id; for (const note of newNotes) { fetchedNoteIds.add(note.id); } diff --git a/package.json b/package.json index 3886b27..5179852 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "dependencies": { "@ark-ui/vue": "^3.3.1", - "@lysand-org/client": "^0.1.6", + "@lysand-org/client": "^0.1.7", "@nuxt/fonts": "^0.7.0", "@tailwindcss/typography": "^0.5.13", "@vee-validate/nuxt": "^4.13.1", @@ -49,7 +49,7 @@ "nuxt-shiki": "^0.3.0", "overlayscrollbars": "^2.8.3", "overlayscrollbars-vue": "^0.5.9", - "shiki": "^1.6.3", + "shiki": "^1.6.4", "vue": "^3.4.27", "vue-router": "^4.3.3", "zod": "^3.23.8" diff --git a/types/mastodon/account.ts b/types/mastodon/account.ts index 9d796c8..6dfec5f 100644 --- a/types/mastodon/account.ts +++ b/types/mastodon/account.ts @@ -1,3 +1,4 @@ +import type { Role as LysandRole } from "~/composables/Identities"; import type { Emoji } from "./emoji"; import type { Field } from "./field"; import type { Role } from "./role"; @@ -30,5 +31,6 @@ export type Account = { bot: boolean | null; source?: Source; role?: Role; + roles: LysandRole[]; mute_expires_at?: string; };