mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 02:37:05 +02:00
fix: discard shot on tank change
This commit is contained in:
1 parent
42f1dd33b5
commit
a1b25e1e52
1 file changed
+13
@@ -57,6 +57,19 @@ export default function Page({ params }: { params: { id: string } }) {
|
||||
};
|
||||
}, [initialId, assigned]);
|
||||
|
||||
useEffect(() => {
|
||||
const unsubscribe = useDuel.subscribe(
|
||||
(state) => state.protagonist?.tank.id,
|
||||
() => {
|
||||
mutateTankopediaTemporary((draft) => {
|
||||
draft.shot = undefined;
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
return unsubscribe;
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<PageWrapper noPadding noMaxWidth color="purple" size={1600}>
|
||||
{assigned && (
|
||||
|
||||
Reference in new issue
Block a user