fix(ssr): fix pagination being broken on inital player page load
All checks were successful
deploy / deploy (push) Successful in 1m44s

This commit is contained in:
Lee
2023-11-08 08:40:49 +00:00
parent 0a8878cdac
commit fb38ac69df
3 changed files with 9 additions and 10 deletions

View File

@ -22,15 +22,17 @@ type PageInfo = {
type ScoresProps = {
initalScores: ScoresaberPlayerScore[] | undefined;
initalPage: number;
playerData: ScoresaberPlayer;
initalSortType: SortType;
initalTotalPages?: number;
playerData: ScoresaberPlayer;
};
export default function Scores({
initalScores,
playerData,
initalPage,
initalSortType,
initalTotalPages,
playerData,
}: ScoresProps) {
const settingsStore = useStore(useSettingsStore, (store) => store);
const playerId = playerData.id;
@ -41,7 +43,7 @@ export default function Scores({
const [scores, setScores] = useState<PageInfo>({
page: initalPage,
totalPages: 1,
totalPages: initalTotalPages || 1,
sortType: initalSortType,
scores: initalScores ? initalScores : [],
});