Commit a3617792 authored by Chunchi Che's avatar Chunchi Che

rename something

parent 04548ae3
Pipeline #23642 passed with stages
in 15 minutes and 54 seconds
......@@ -34,8 +34,8 @@ interface Options {
}
export const WatchContent: React.FC<{
setWatchPasswd: React.Dispatch<React.SetStateAction<string | undefined>>;
}> = ({ setWatchPasswd }) => {
setWatchID: React.Dispatch<React.SetStateAction<string | undefined>>;
}> = ({ setWatchID }) => {
const [rooms, setRooms] = useState<Room[]>([]);
const { message } = App.useApp();
const url = new URL(athleticWatchUrl);
......@@ -101,7 +101,7 @@ export const WatchContent: React.FC<{
}}
dataSource={rooms}
renderItem={(room) => (
<List.Item key={room.id} onClick={() => setWatchPasswd(room.id)}>
<List.Item key={room.id} onClick={() => setWatchID(room.id)}>
<List.Item.Meta
avatar={
<Avatar
......
......@@ -18,7 +18,7 @@ import styles from "./index.module.scss";
import { MatchModal, matchStore } from "./MatchModal";
import { ReplayModal, replayOpen } from "./ReplayModal";
import { connectSrvpro } from "./util";
import { WatchContent } from "./WatchModal";
import { WatchContent } from "./WatchContent";
const { servers: serverList } = useConfig();
......@@ -38,7 +38,7 @@ export const Component: React.FC = () => {
const [singleLoading, setSingleLoading] = useState(false); // 单人模式的loading状态
const [matchLoading, setMatchLoading] = useState(false); // 匹配模式的loading状态
const [watchLoading, setWatchLoading] = useState(false); // 观战模式的loading状态
const [watchPasswd, setWatchPasswd] = useState<string | undefined>(undefined);
const [watchID, setWatchID] = useState<string | undefined>(undefined);
const navigate = useNavigate();
// 竞技匹配
......@@ -73,7 +73,7 @@ export const Component: React.FC = () => {
icon: null,
okText: "进入观战",
onOk: async () => {
if (watchPasswd) {
if (watchID) {
setWatchLoading(true);
const mcServer = serverList.find(
......@@ -83,7 +83,7 @@ export const Component: React.FC = () => {
await connectSrvpro({
ip: mcServer.ip + ":" + mcServer.port,
player: user.username,
passWd: watchPasswd,
passWd: watchID,
});
} else {
message.error(
......@@ -96,7 +96,7 @@ export const Component: React.FC = () => {
},
centered: true,
maskClosable: true,
content: <WatchContent setWatchPasswd={setWatchPasswd} />,
content: <WatchContent setWatchID={setWatchID} />,
});
}
};
......
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