update
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -51,7 +51,7 @@ export function useFriendsPresence(userIds: number[]) {
|
||||
// assert is shit
|
||||
if (!res.ok) {
|
||||
throw "wtf?";
|
||||
};
|
||||
}
|
||||
|
||||
const json = await res.json();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user