chore: ⬆️ Update @lysand-org/client for new types

This commit is contained in:
Jesse Wierzbinski 2024-06-11 15:02:30 -10:00
parent 18b4bc64b3
commit a889f8d142
No known key found for this signature in database
10 changed files with 19 additions and 15 deletions

BIN
bun.lockb

Binary file not shown.

View file

@ -19,8 +19,10 @@
</div> </div>
<div v-if="notification?.type === 'follow_request' && relationship?.requested_by" <div v-if="notification?.type === 'follow_request' && relationship?.requested_by"
class="w-full grid grid-cols-2 gap-4 p-2 "> class="w-full grid grid-cols-2 gap-4 p-2 ">
<ButtonsPrimary :loading="isWorkingOnFollowRequest" @click="acceptFollowRequest"><span>Accept</span></ButtonsPrimary> <ButtonsPrimary :loading="isWorkingOnFollowRequest" @click="acceptFollowRequest"><span>Accept</span>
<ButtonsSecondary :loading="isWorkingOnFollowRequest" @click="rejectFollowRequest"><span>Reject</span></ButtonsSecondary> </ButtonsPrimary>
<ButtonsSecondary :loading="isWorkingOnFollowRequest" @click="rejectFollowRequest"><span>Reject</span>
</ButtonsSecondary>
</div> </div>
</div> </div>
</div> </div>
@ -47,7 +49,7 @@ const acceptFollowRequest = async () => {
const { data } = await client.value.acceptFollowRequest( const { data } = await client.value.acceptFollowRequest(
props.notification.account.id, props.notification.account.id,
); );
relationship.value = data as Relationship; relationship.value = data;
isWorkingOnFollowRequest.value = false; isWorkingOnFollowRequest.value = false;
}; };
@ -57,7 +59,7 @@ const rejectFollowRequest = async () => {
const { data } = await client.value.rejectFollowRequest( const { data } = await client.value.rejectFollowRequest(
props.notification.account.id, props.notification.account.id,
); );
relationship.value = data as Relationship; relationship.value = data;
isWorkingOnFollowRequest.value = false; isWorkingOnFollowRequest.value = false;
}; };

View file

@ -106,7 +106,7 @@ export const useCurrentIdentity = (): Ref<Identity | null> => {
); );
if (identities.value.length > 0) { if (identities.value.length > 0) {
currentId.value = identities.value[0].id; currentId.value = identities.value[0]?.id;
} else { } else {
currentId.value = null; currentId.value = null;
} }

View file

@ -14,7 +14,7 @@ export const useNote = (
ref(client) ref(client)
.value?.getStatus(noteId) .value?.getStatus(noteId)
.then((res) => { .then((res) => {
output.value = res.data as Status; output.value = res.data;
}); });
return output; return output;

View file

@ -16,7 +16,7 @@ export const useNoteContext = (
ref(client) ref(client)
.value?.getStatusContext(toValue(noteId) ?? "") .value?.getStatusContext(toValue(noteId) ?? "")
.then((res) => { .then((res) => {
output.value = res.data as Context; output.value = res.data;
}); });
}); });

View file

@ -58,7 +58,7 @@ export const useNoteData = (
); );
if (result?.data) { if (result?.data) {
useEvent("note:delete", result.data as Status); useEvent("note:delete", result.data);
} }
}; };

View file

@ -18,7 +18,7 @@ export const useRelationship = (
toValue(client) toValue(client)
?.getRelationship(toValue(accountId) ?? "") ?.getRelationship(toValue(accountId) ?? "")
.then((res) => { .then((res) => {
relationship.value = res.data as Relationship; relationship.value = res.data;
}); });
}); });

View file

@ -49,7 +49,7 @@ export const useTimeline = <
); );
if (newNotes.length > 0) { if (newNotes.length > 0) {
fetchedNotes.value = [...fetchedNotes.value, ...newNotes]; fetchedNotes.value = [...fetchedNotes.value, ...newNotes];
nextMaxId = newNotes[newNotes.length - 1].id; nextMaxId = newNotes[newNotes.length - 1]?.id;
for (const note of newNotes) { for (const note of newNotes) {
fetchedNoteIds.add(note.id); fetchedNoteIds.add(note.id);
} }
@ -70,7 +70,7 @@ export const useTimeline = <
); );
if (newNotes.length > 0) { if (newNotes.length > 0) {
fetchedNotes.value = [...newNotes, ...fetchedNotes.value]; fetchedNotes.value = [...newNotes, ...fetchedNotes.value];
prevMinId = newNotes[0].id; prevMinId = newNotes[0]?.id;
for (const note of newNotes) { for (const note of newNotes) {
fetchedNoteIds.add(note.id); fetchedNoteIds.add(note.id);
} }
@ -132,7 +132,7 @@ export const useIdTimeline = <
); );
if (newNotes.length > 0) { if (newNotes.length > 0) {
fetchedNotes.value = [...fetchedNotes.value, ...newNotes]; fetchedNotes.value = [...fetchedNotes.value, ...newNotes];
nextMaxId = newNotes[newNotes.length - 1].id; nextMaxId = newNotes[newNotes.length - 1]?.id;
for (const note of newNotes) { for (const note of newNotes) {
fetchedNoteIds.add(note.id); fetchedNoteIds.add(note.id);
} }
@ -153,7 +153,7 @@ export const useIdTimeline = <
); );
if (newNotes.length > 0) { if (newNotes.length > 0) {
fetchedNotes.value = [...newNotes, ...fetchedNotes.value]; fetchedNotes.value = [...newNotes, ...fetchedNotes.value];
prevMinId = newNotes[0].id; prevMinId = newNotes[0]?.id;
for (const note of newNotes) { for (const note of newNotes) {
fetchedNoteIds.add(note.id); fetchedNoteIds.add(note.id);
} }

View file

@ -30,7 +30,7 @@
}, },
"dependencies": { "dependencies": {
"@ark-ui/vue": "^3.3.1", "@ark-ui/vue": "^3.3.1",
"@lysand-org/client": "^0.1.6", "@lysand-org/client": "^0.1.7",
"@nuxt/fonts": "^0.7.0", "@nuxt/fonts": "^0.7.0",
"@tailwindcss/typography": "^0.5.13", "@tailwindcss/typography": "^0.5.13",
"@vee-validate/nuxt": "^4.13.1", "@vee-validate/nuxt": "^4.13.1",
@ -49,7 +49,7 @@
"nuxt-shiki": "^0.3.0", "nuxt-shiki": "^0.3.0",
"overlayscrollbars": "^2.8.3", "overlayscrollbars": "^2.8.3",
"overlayscrollbars-vue": "^0.5.9", "overlayscrollbars-vue": "^0.5.9",
"shiki": "^1.6.3", "shiki": "^1.6.4",
"vue": "^3.4.27", "vue": "^3.4.27",
"vue-router": "^4.3.3", "vue-router": "^4.3.3",
"zod": "^3.23.8" "zod": "^3.23.8"

View file

@ -1,3 +1,4 @@
import type { Role as LysandRole } from "~/composables/Identities";
import type { Emoji } from "./emoji"; import type { Emoji } from "./emoji";
import type { Field } from "./field"; import type { Field } from "./field";
import type { Role } from "./role"; import type { Role } from "./role";
@ -30,5 +31,6 @@ export type Account = {
bot: boolean | null; bot: boolean | null;
source?: Source; source?: Source;
role?: Role; role?: Role;
roles: LysandRole[];
mute_expires_at?: string; mute_expires_at?: string;
}; };