This commit is contained in:
2025-12-27 16:57:19 +02:00
parent 5bfdd7dd2b
commit 331ff6daf3
31 changed files with 1049 additions and 429 deletions

View File

@@ -6,9 +6,9 @@ import { proxyFetch } from "@/lib/utils";
import { loadThumbnails } from "@/lib/thumbnailLoader";
import assert from "assert";
export function useFriendsHome( targetId?: string ) {
export function useFriendsHome(targetId?: string) {
const acct = useCurrentAccount();
const target = targetId || (acct ? acct.id : "acctId")
const target = targetId || (acct ? acct.id : "acctId");
const { data: friends } = useQuery({
queryKey: ["friends", target],
queryFn: async () => {
@@ -47,15 +47,20 @@ export function useFriendsHome( targetId?: string ) {
format: "webp"
}))
).catch(() => {});
const friendsList = j.data.map((a) => {
const x = j2.data.find((b) => b.id === a.id);
return !!x ? {
id: a.id,
hasVerifiedBadge: x?.hasVerifiedBadge || false,
name: x?.name || "?",
displayName: x?.displayName || "?"
} : null;
}).filter(a=>!!a).filter(a=>a.id.toString()!=="-1");
const friendsList = j.data
.map((a) => {
const x = j2.data.find((b) => b.id === a.id);
return !!x
? {
id: a.id,
hasVerifiedBadge: x?.hasVerifiedBadge || false,
name: x?.name || "?",
displayName: x?.displayName || "?"
}
: null;
})
.filter((a) => !!a)
.filter((a) => a.id.toString() !== "-1");
return friendsList;
},
enabled: !!acct,

View File

@@ -18,14 +18,25 @@ type PlaceDetails = {
name: string;
description: string;
creator: Creator;
sourceName: string | null;
sourceDescription: string | null;
price: number | null;
allowedGearGenres: string[];
allowedGearCategories: string[];
isGenreEnforced: boolean;
copyingAllowed: boolean;
playing: number;
visits: number;
maxPlayers: number;
created: string;
updated: string;
studioAccessToApisAllowed: boolean;
createVipServersAllowed: boolean;
genre: string;
genre_l1?: string;
genre_l2?: string;
untranslated_genre_l1?: string;
isAllGenre?: boolean;
favoritedCount: number;
isFavoritedByUser: boolean;
universeAvatarType: string;

View File

@@ -51,7 +51,7 @@ export function useFriendsPresence(userIds: number[]) {
// assert is shit
if (!res.ok) {
throw "wtf?";
};
}
const json = await res.json();