Commit 23b803a0 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'fix/duel_end_v2' into 'main'

Fix/duel end v2

See merge request !398
parents 17edc027 e633a532
Pipeline #28721 passed with stages
in 13 minutes and 1 second
......@@ -84,4 +84,8 @@ export class WebSocketStream {
close() {
this.ws.close();
}
isClosed(): boolean {
return this.ws.readyState === WebSocket.CLOSED;
}
}
......@@ -127,7 +127,7 @@ export const DeckDatabase: React.FC = () => {
<Space className={styles.title} direction="horizontal">
<Input
placeholder={i18n("KeywordsPlaceholder")}
bordered={false}
variant="borderless"
suffix={
<Button
type="text"
......
......@@ -74,7 +74,7 @@ export const AnnounceModal: React.FC = () => {
<Input
className={styles.input}
placeholder="请输入宣言卡名(或关键字)"
bordered={false}
variant="borderless"
value={searchWord}
onChange={(e) => setSearchWord(e.target.value)}
suffix={
......
import { App } from "antd";
import React, { CSSProperties } from "react";
import { useNavigate } from "react-router-dom";
import { proxy, useSnapshot } from "valtio";
import { fetchStrings, Region } from "@/api";
import { getUIContainer } from "@/container/compat";
import { replayStore, resetDuel } from "@/stores";
import { NeosModal } from "../NeosModal";
......@@ -21,12 +24,21 @@ const defaultProps: EndProps = {
const localStore = proxy(defaultProps);
export const EndModal: React.FC = () => {
const container = getUIContainer();
const { message } = App.useApp();
const { isOpen, isWin, reason } = useSnapshot(localStore);
const { isReplay } = useSnapshot(replayStore);
const navigate = useNavigate();
const onReturn = () => {
resetDuel();
rs();
if (container.conn.isClosed()) {
message.info("服务器关闭了连接,返回匹配页。");
navigate("/match");
}
};
return (
......
......@@ -39,7 +39,7 @@ export const ChatBox: React.FC = () => {
</ScrollableArea>
<div className={styles.input}>
<Input.TextArea
bordered={false}
variant="borderless"
value={input}
onChange={(event) => setInput(event.target.value)}
autoSize
......
......@@ -28,6 +28,7 @@ import {
import { useConfig } from "@/config";
import { accountStore } from "@/stores";
import { setCssProperties } from "../Duel/PlayMat/css";
import { Setting } from "../Setting";
import styles from "./index.module.scss";
import {
......@@ -40,7 +41,6 @@ import {
initSuper,
initWASM,
} from "./utils";
import { setCssProperties } from "../Duel/PlayMat/css";
const NeosConfig = useConfig();
......
......@@ -23,7 +23,7 @@ export const Chat: React.FC = () => {
</ScrollableArea>
<div className={styles.input}>
<Input.TextArea
bordered={false}
variant="borderless"
value={input}
onChange={(event) => setInput(event.target.value)}
autoSize
......
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