fix padding issues (#4604)

This commit is contained in:
Prospector
2025-10-24 11:58:20 -07:00
committed by GitHub
parent ab886a5ea8
commit 5dd6c804d0
5 changed files with 86 additions and 45 deletions

View File

@@ -50,13 +50,13 @@ export async function transformFriends(
friends: UserFriend[],
credentials: ModrinthCredentials | null,
): Promise<FriendWithUserData[]> {
if (friends.length === 0) {
if (friends.length === 0 || !credentials) {
return []
}
const friendStatuses = await friend_statuses()
const users = await get_user_many(
friends.map((x) => (x.id === credentials?.user_id ? x.friend_id : x.id)),
friends.map((x) => (x.id === credentials.user_id ? x.friend_id : x.id)),
)
return friends.map((friend) => {