mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: window undefined check
This commit is contained in:
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 [searchResults, setSearchedList] = useState(searchableTanks);
|
||||||
const page = useTankopediaPersistent((state) => state.filters.page);
|
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(
|
const searchResultsPageSlice = searchResults.slice(
|
||||||
page * tanksPerPage,
|
page * tanksPerPage,
|
||||||
(page + 1) * tanksPerPage,
|
(page + 1) * tanksPerPage,
|
||||||
|
|||||||
Reference in new issue
Block a user