debug
This commit is contained in:
parent
b515a4ab36
commit
1abccba69d
|
@ -0,0 +1 @@
|
|||
.git
|
|
@ -15,6 +15,7 @@ const ChatPage = () => {
|
|||
const tick = useRef()
|
||||
const [timer, setTimer] = useState(0);
|
||||
const [stat, setStat] = useState("start");
|
||||
const [err, setErr] = useState("");
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -29,6 +30,7 @@ const ChatPage = () => {
|
|||
},
|
||||
}).then(r => r.json()).then(r => {
|
||||
setStat(r.stat);
|
||||
setErr(r.err);
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
|
@ -48,6 +50,7 @@ const ChatPage = () => {
|
|||
},
|
||||
}).then(r => r.json()).then(r => {
|
||||
setStat(r.stat);
|
||||
setErr(r.err);
|
||||
}).catch((error) => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
|
@ -69,10 +72,10 @@ const ChatPage = () => {
|
|||
}
|
||||
return (
|
||||
<div>
|
||||
{stat==="waiting" && <p>Loading resources...</p>}
|
||||
{stat==="start" && <p>Connecting to Server...</p>}
|
||||
{stat==="rejected" && <p>Unauthorized Use...</p>}
|
||||
{stat==="init_dm_error" && <p>DM Init Err...</p>}
|
||||
{stat==="waiting" && <p>Loading resources + {token} ...</p>}
|
||||
{stat==="start" && <p>Connecting to Server + {token} ...</p>}
|
||||
{stat==="rejected" && <p>Unauthorized Use + {token} ...</p>}
|
||||
{stat==="init_dm_error" && <p> {err} + {token} </p>}
|
||||
|
||||
{stat==="done" && <ChatBox props={{ updateNeedForm, messages, updateMessages, token}} /> }
|
||||
{stat==="done" && needForm && <FeedbackForm props={{ updateNeedForm, messages }} /> }
|
||||
|
|
Loading…
Reference in New Issue