Commit 12b44c96 authored by timel's avatar timel

refactor: code order

parent d5800458
Pipeline #21147 failed with stages
in 4 minutes and 5 seconds
...@@ -32,6 +32,15 @@ const Mora = () => { ...@@ -32,6 +32,15 @@ const Mora = () => {
ip?: string; ip?: string;
}>(); }>();
const handleSelectMora = (selected: string) => {
sendHandResult(selected);
dispatch(unSelectHandAble());
};
const handleSelectTp = (isFirst: boolean) => {
sendTpResult(isFirst);
dispatch(unSelectTpAble());
};
useEffect(() => { useEffect(() => {
// 若对局已经开始,自动跳转 // 若对局已经开始,自动跳转
if (duelHsStart) { if (duelHsStart) {
...@@ -51,15 +60,6 @@ const Mora = () => { ...@@ -51,15 +60,6 @@ const Mora = () => {
} }
}, [selectHandAble, selectTpAble]); }, [selectHandAble, selectTpAble]);
const handleSelectMora = (selected: string) => {
sendHandResult(selected);
dispatch(unSelectHandAble());
};
const handleSelectTp = (isFirst: boolean) => {
sendTpResult(isFirst);
dispatch(unSelectTpAble());
};
return ( return (
<> <>
<Modal title="请选择猜拳" open={selectHandAble} footer={<></>}> <Modal title="请选择猜拳" open={selectHandAble} footer={<></>}>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment