switch to last used sort type
All checks were successful
deploy / deploy (push) Successful in 48s

This commit is contained in:
Lee 2023-10-23 18:59:17 +01:00
parent 5bf0f8ac62
commit 0fab52a16b

@ -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/${