fix: window undefined check

This commit is contained in:
TrèsAbhi committed 2024-01-21 21:06:12 -06:00
1 parent 86353dc1cf
commit a0c9895122
1 file changed
+4 -1
@@ -82,7 +82,10 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
);
const [searchResults, setSearchedList] = useState(searchableTanks);
const page = useTankopediaPersistent((state) => state.filters.page);
const chunkSize = window.innerWidth > 512 ? tanksPerPage / 2 : Infinity;
const chunkSize =
typeof window !== 'undefined' && window.innerWidth > 512
? tanksPerPage / 2
: Infinity;
const searchResultsPageSlice = searchResults.slice(
page * tanksPerPage,
(page + 1) * tanksPerPage,