Commit 6616280f authored by Chunchi Che's avatar Chunchi Che

fix alert

parent bc5a3760
Pipeline #20789 passed with stages
in 12 minutes and 56 seconds
...@@ -149,10 +149,8 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -149,10 +149,8 @@ export default class GameMsgAdapter implements StocAdapter {
break; break;
} }
default: { default: {
gameMsg.unimplemented = new ygopro.StocGameMessage({ gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({
unimplemented: new ygopro.StocGameMessage.MsgUnimplemented({ command: func,
command: func,
}),
}); });
break; break;
......
import { Alert } from "antd";
import React from "react"; import React from "react";
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import { sendSurrender } from "../../api/ocgcore/ocgHelper";
import { useAppSelector } from "../../hook"; import { useAppSelector } from "../../hook";
import { selectUnimplemented } from "../../reducers/duel/mod"; import { selectUnimplemented } from "../../reducers/duel/mod";
import { Alert } from "antd";
const NeosAlert = () => { const NeosAlert = () => {
const unimplemented = useAppSelector(selectUnimplemented); const unimplemented = useAppSelector(selectUnimplemented);
...@@ -17,7 +18,10 @@ const NeosAlert = () => { ...@@ -17,7 +18,10 @@ const NeosAlert = () => {
showIcon showIcon
type="error" type="error"
closable closable
banner
afterClose={() => { afterClose={() => {
// 发送投降信号
sendSurrender();
navigate("/"); navigate("/");
}} }}
/> />
......
...@@ -31,6 +31,7 @@ import Alert from "./alert"; ...@@ -31,6 +31,7 @@ import Alert from "./alert";
const NeosDuel = () => { const NeosDuel = () => {
return ( return (
<> <>
<Alert />
<NeosLayout <NeosLayout
sider={<NeosSider />} sider={<NeosSider />}
header={<PlayerStatus />} header={<PlayerStatus />}
...@@ -45,7 +46,6 @@ const NeosDuel = () => { ...@@ -45,7 +46,6 @@ const NeosDuel = () => {
<PositionModal /> <PositionModal />
<OptionModal /> <OptionModal />
<CheckCardModalV2 /> <CheckCardModalV2 />
<Alert />
</> </>
); );
}; };
......
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