Skip to content

Commit

Permalink
Fix gamemode checks
Browse files Browse the repository at this point in the history
  • Loading branch information
seditionist committed Nov 26, 2023
1 parent bdfdf1e commit 5614956
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/hiscores.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,17 +287,13 @@ export async function getStats(

const main = await getOfficialStats(rsn, 'main', options?.axiosConfigs?.main);

const emptyResponse: HiscoresResponse = {
skills: [],
activities: []
};
const getModeStats = async (
mode: Extract<Gamemode, 'ironman' | 'hardcore' | 'ultimate'>
): Promise<HiscoresResponse | undefined> =>
otherGamemodes.includes(mode)
? getOfficialStats(rsn, mode, options?.axiosConfigs?.[mode])
.catch(err => err)
: emptyResponse;
.catch(() => undefined)
: undefined;
const formattedName = shouldGetFormattedRsn
? await getRSNFormat(rsn, options?.axiosConfigs?.rsn).catch(
() => undefined
Expand Down

0 comments on commit 5614956

Please sign in to comment.