feat: ui adjustments and add friend playing game

This commit is contained in:
Zamitto
2024-12-22 16:47:13 -03:00
parent 93bc7c690f
commit 041b7d520c
7 changed files with 62 additions and 14 deletions

View File

@@ -11,7 +11,7 @@ const getSteamGame = async (objectId: string) => {
});
return {
title: steamGame.name,
title: steamGame.name as string,
iconUrl: steamUrlBuilder.icon(objectId, steamGame.clientIcon),
};
} catch (err) {
@@ -67,8 +67,25 @@ const getUser = async (
}
}
const friends = await Promise.all(
profile.friends.map(async (friend) => {
if (!friend.currentGame) return friend;
const currentGame = await getSteamGame(friend.currentGame.objectId);
return {
...friend,
currentGame: {
...friend.currentGame,
...currentGame,
},
};
})
);
return {
...profile,
friends,
libraryGames,
recentGames,
};

View File

@@ -30,7 +30,7 @@ export class HydraApi {
private static instance: AxiosInstance;
private static readonly EXPIRATION_OFFSET_IN_MS = 1000 * 60 * 5; // 5 minutes
private static readonly ADD_LOG_INTERCEPTOR = false;
private static readonly ADD_LOG_INTERCEPTOR = true;
private static secondsToMilliseconds = (seconds: number) => seconds * 1000;