mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-19 20:03:51 +01:00
fix: no null return before hook
This commit is contained in:
1 parent
c9eee14b21
commit
909474d4cb
4 files changed
+35
-27
No files matched your search
@@ -42,8 +42,6 @@ export function TankDisplay() {
|
||||
return state.protagonist;
|
||||
});
|
||||
|
||||
if (!protagonist) return null;
|
||||
|
||||
function handlePointerDown() {
|
||||
window.addEventListener('pointermove', handlePointerMove);
|
||||
window.addEventListener('pointerup', handlePointerUp);
|
||||
@@ -71,6 +69,8 @@ export function TankDisplay() {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (!protagonist) return void 0;
|
||||
|
||||
const tankModelDefinition = awaitedModelDefinitions[protagonist.tank.id];
|
||||
const turretModelDefinition =
|
||||
tankModelDefinition.turrets[protagonist.turret.id];
|
||||
@@ -84,7 +84,9 @@ export function TankDisplay() {
|
||||
turretModelDefinition.yaw,
|
||||
);
|
||||
});
|
||||
}, [protagonist.gun, protagonist.turret]);
|
||||
}, [protagonist?.gun, protagonist?.turret]);
|
||||
|
||||
if (!protagonist) return null;
|
||||
|
||||
return (
|
||||
<Theme radius={isFullScreen ? 'none' : undefined}>
|
||||
|
||||
Reference in new issue
Block a user