From df43d432d8f19fc8c07d6e2a852c3487a7f76b1a Mon Sep 17 00:00:00 2001 From: Tiyo Date: Mon, 27 Nov 2023 19:27:40 +0800 Subject: [PATCH] fix: fix bug --- packages/client/src/components/Log/index.jsx | 9 +++++---- packages/client/src/pages/game/index.tsx | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/packages/client/src/components/Log/index.jsx b/packages/client/src/components/Log/index.jsx index 269c76d4..4a316c47 100644 --- a/packages/client/src/components/Log/index.jsx +++ b/packages/client/src/components/Log/index.jsx @@ -26,10 +26,11 @@ const Log = () => { } setLogs([...logs]); } - eventEmitter?.on('log', addLogCb); - return () => { - eventEmitter?.off('log', addLogCb); - }; + try { + eventEmitter?.on('log', addLogCb); + } catch (error) { + console.log('eventEmitter.on error', error); + } }, []); return ( diff --git a/packages/client/src/pages/game/index.tsx b/packages/client/src/pages/game/index.tsx index cb53e399..70816508 100644 --- a/packages/client/src/pages/game/index.tsx +++ b/packages/client/src/pages/game/index.tsx @@ -487,7 +487,9 @@ const Game = () => { : } - + { + curPlayer && percentage == 100 ? : null + }