Compare commits

..

2 Commits

Author SHA1 Message Date
0fab52a16b switch to last used sort type
All checks were successful
deploy / deploy (push) Successful in 48s
2023-10-23 18:59:17 +01:00
5bf0f8ac62 update error msg 2023-10-23 18:52:32 +01:00
2 changed files with 14 additions and 2 deletions

View File

@ -93,7 +93,7 @@ export default async function Player({
<main> <main>
<Container> <Container>
<Card className="mt-2"> <Card className="mt-2">
<Error errorMessage="Failed to load player. Is the is valid?" /> <Error errorMessage="Failed to load player. Is the ID valid?" />
</Card> </Card>
</Container> </Container>
</main> </main>

View File

@ -30,9 +30,21 @@ export default function Scores({
const router = useRouter(); const router = useRouter();
const lastUsedSortType = settingsStore?.lastUsedSortType;
if (lastUsedSortType && lastUsedSortType != sortType) {
router.push(
`/player/${playerId}/scoresaber/${lastUsedSortType.value}/${page}`,
{
scroll: false,
},
);
}
function setPage(page: number, sortTypee?: SortType) { function setPage(page: number, sortTypee?: SortType) {
if (sortTypee) { if (sortTypee) {
settingsStore?.setLastUsedSortType(sortTypee); if (sortTypee.value !== sortType.value) {
settingsStore?.setLastUsedSortType(sortTypee);
}
} }
router.push( router.push(
`/player/${playerId}/scoresaber/${ `/player/${playerId}/scoresaber/${