feat: edit headers

This commit is contained in:
tresabhi committed 2024-11-26 20:44:44 -06:00
1 parent 53d811eeef
commit 5f256ed84d
10 files changed
+155 -50

No files matched your search

@@ -6,7 +6,7 @@ import { TierList } from '../../stores/tierList';
const tankDefinitions = await fetchTankDefinitions();
export function URLManager() {
const tanks = TierList.use((state) => state.tanks);
const rows = TierList.use((state) => state.rows);
const mutateTierList = TierList.useMutation();
useEffect(() => {
@@ -21,15 +21,15 @@ export function URLManager() {
.filter((id) => id in tankDefinitions.tanks);
mutateTierList((draft) => {
draft.tanks[index] = values;
draft.rows[index].tanks = values;
});
}
});
}, []);
useEffect(() => {
window.history.replaceState(null, '', `?${generateTierListParams(tanks)}`);
}, [tanks]);
window.history.replaceState(null, '', `?${generateTierListParams(rows)}`);
}, [rows]);
return null;
}