From a9f2ba776a87b6a09c66d53e9621819f22329e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Fri, 9 Feb 2024 16:04:09 -0600 Subject: [PATCH] fix: filter reset --- .../tankopedia/components/TankSearch/index.tsx | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/app/tools/tankopedia/components/TankSearch/index.tsx b/src/app/tools/tankopedia/components/TankSearch/index.tsx index ea71ef255..7d06faf4e 100644 --- a/src/app/tools/tankopedia/components/TankSearch/index.tsx +++ b/src/app/tools/tankopedia/components/TankSearch/index.tsx @@ -97,19 +97,6 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) { ); let sorted: TankDefinition[] = []; - // .sort((a, b) => { - // let diff = 0; - - // if (sort.by === 'meta.tier') { - // diff = a.tier - b.tier; - // } - // if (sort.by === 'meta.name') { - // diff = a.name?.localeCompare(b.name); - // } - - // return sort.direction === 'ascending' ? diff : -diff; - // }); - switch (sort.by) { case 'meta.tier': sorted = filtered.sort((a, b) => a.tier - b.tier); @@ -749,6 +736,10 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) { test: 'include', page: 0, }, + sort: { + by: 'meta.tier', + direction: 'descending', + }, }) } >