mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +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]);
|
}, [initialId, assigned]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const unsubscribe = useDuel.subscribe(
|
||||||
|
(state) => state.protagonist?.tank.id,
|
||||||
|
() => {
|
||||||
|
mutateTankopediaTemporary((draft) => {
|
||||||
|
draft.shot = undefined;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
return unsubscribe;
|
||||||
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<PageWrapper noPadding noMaxWidth color="purple" size={1600}>
|
<PageWrapper noPadding noMaxWidth color="purple" size={1600}>
|
||||||
{assigned && (
|
{assigned && (
|
||||||
|
|||||||
Reference in new issue
Block a user