mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: upgrade rest of them
This commit is contained in:
1 parent
fe4afdcbf0
commit
30e87743fc
63 files changed
+824
-1123
No files matched your search
@@ -12,12 +12,11 @@ import { TankCardWrapper } from "./TankCardWrapper";
|
||||
const tankDefinitions = await awaitableTankDefinitions;
|
||||
|
||||
export function RecentlyViewed() {
|
||||
const tankopediaPersistentStore = TankopediaPersistent.useStore();
|
||||
const filters = TankFilters.use();
|
||||
// non-reactive because it is a little weird that it updates instantly even before the page loads
|
||||
const recentlyViewed = tankopediaPersistentStore
|
||||
.getState()
|
||||
.recentlyViewed.filter((id) => id in tankDefinitions.tanks);
|
||||
const recentlyViewed = TankopediaPersistent.state.recentlyViewed.filter(
|
||||
(id) => id in tankDefinitions.tanks
|
||||
);
|
||||
const hasFilters = useMemo(
|
||||
() =>
|
||||
Object.entries(filters).some(([key, value]) => {
|
||||
|
||||
@@ -54,7 +54,7 @@ const [gameDefinitions, modelDefinitions, tankDefinitions, tankNames] =
|
||||
export const TankSearch = memo<TankSearchProps>(
|
||||
({ compact, onSelect, onSelectAll, skeleton, ...props }) => {
|
||||
const { strings, locale } = useLocale();
|
||||
const mutateTankopediaPersistent = TankopediaPersistent.useMutation();
|
||||
|
||||
const awaitedTanksDefinitionsArray = Object.values(tankDefinitions.tanks);
|
||||
const tankopediaSort = TankSort.use();
|
||||
const tankFilters = TankFilters.use();
|
||||
@@ -443,7 +443,7 @@ export const TankSearch = memo<TankSearchProps>(
|
||||
onClick={(event) => {
|
||||
event.preventDefault();
|
||||
onSelectAll(tanksFiltered);
|
||||
mutateTankopediaPersistent((draft) => {
|
||||
TankopediaPersistent.mutate((draft) => {
|
||||
draft.recentlyViewed = uniq([
|
||||
...tanksFiltered.map(({ id }) => id),
|
||||
...draft.recentlyViewed,
|
||||
|
||||
Reference in new issue
Block a user