From 882e61ff444de264a0c2d24cef952e3cd06aaab5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 1 Nov 2023 11:27:41 -0500 Subject: [PATCH] feat: isolated first archived season number --- src/app/tools/ratings/page.tsx | 2 +- src/commands/ratings.tsx | 2 +- src/constants/ratings.ts | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 src/constants/ratings.ts diff --git a/src/app/tools/ratings/page.tsx b/src/app/tools/ratings/page.tsx index a46a78fa2..0c1c4c01f 100644 --- a/src/app/tools/ratings/page.tsx +++ b/src/app/tools/ratings/page.tsx @@ -16,6 +16,7 @@ import useSWR from 'swr'; import { create } from 'zustand'; import * as Leaderboard from '../../../components/Leaderboard'; import PageWrapper from '../../../components/PageWrapper'; +import { FIRST_ARCHIVED_RATINGS_SEASON } from '../../../constants/ratings'; import { REGIONS, REGION_NAMES, Region } from '../../../constants/regions'; import { getAccountInfo } from '../../../core/blitz/getAccountInfo'; import { getClanAccountInfo } from '../../../core/blitz/getClanAccountInfo'; @@ -25,7 +26,6 @@ import { getArchivedRatingsLeaderboardAPI } from '../../../core/blitzkrieg/getAr import { numberFetcher } from '../../../core/blitzkrieg/numberFetcher'; import { noArrows } from './page.css'; -export const FIRST_ARCHIVED_RATINGS_SEASON = 49; const ROWS_PER_PAGE = 64; const useUsernameCache = create>>(() => ({ diff --git a/src/commands/ratings.tsx b/src/commands/ratings.tsx index 227e0f11f..3961de1a4 100644 --- a/src/commands/ratings.tsx +++ b/src/commands/ratings.tsx @@ -6,10 +6,10 @@ import { } from 'discord.js'; import { range } from 'lodash'; import { BlitzkriegRatingsLeaderboard } from '../../scripts/buildRatingsLeaderboard'; -import { FIRST_ARCHIVED_RATINGS_SEASON } from '../app/tools/ratings/page'; import * as Leaderboard from '../components/Leaderboard'; import TitleBar from '../components/TitleBar'; import Wrapper from '../components/Wrapper'; +import { FIRST_ARCHIVED_RATINGS_SEASON } from '../constants/ratings'; import { REGION_NAMES_SHORT, Region } from '../constants/regions'; import { getAccountInfo } from '../core/blitz/getAccountInfo'; import { getClanAccountInfo } from '../core/blitz/getClanAccountInfo'; diff --git a/src/constants/ratings.ts b/src/constants/ratings.ts new file mode 100644 index 000000000..ec9ead703 --- /dev/null +++ b/src/constants/ratings.ts @@ -0,0 +1 @@ +export const FIRST_ARCHIVED_RATINGS_SEASON = 49;