|
@@ -27,7 +27,7 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
|
|
|
const wallet = useWalletStore((state) => state.wallet);
|
|
|
// 判断是否有未结算的对局
|
|
|
const gameModelRef = useRef<ModalProps>(null)
|
|
|
- const game = useRef<GameListRep & { mode: GameRequest["mode"] } | null>(null);
|
|
|
+ const gameRef = useRef<GameListRep & { mode: GameRequest["mode"] } | null>(null);
|
|
|
|
|
|
const [visible, setVisible] = useState(false);
|
|
|
|
|
@@ -86,7 +86,7 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
|
|
|
}
|
|
|
let unfinishedGame = gameList.find((item: { id: number }) => item?.id === game.id)
|
|
|
if (unfinishedGame) {
|
|
|
- game = unfinishedGame
|
|
|
+ gameRef.current = unfinishedGame
|
|
|
setVisible(false);
|
|
|
gameModelRef.current?.onOpen()
|
|
|
return
|
|
@@ -95,9 +95,9 @@ const Card: FC<PropsWithChildren<CardProps>> = (props) => {
|
|
|
};
|
|
|
|
|
|
const goGame = () => {
|
|
|
- getGameUrl(game.current!, {
|
|
|
- id: game.current?.id + "",
|
|
|
- mode: game.current?.mode!
|
|
|
+ getGameUrl(gameRef.current!, {
|
|
|
+ id: gameRef.current?.id + "",
|
|
|
+ mode: gameRef.current?.mode!
|
|
|
});
|
|
|
}
|
|
|
return (
|