Fixed message not sending when closing db
This commit is contained in:
parent
109b9a1172
commit
b6c5fecae2
1 changed files with 3 additions and 2 deletions
|
|
@ -194,7 +194,8 @@ export default function FormModal({
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleWsMessage(data: any) {
|
function handleWsMessage(data: any) {
|
||||||
if (Array.isArray(data)) {
|
console.log(data);
|
||||||
|
if (Array.isArray(data) && data.length > 0) {
|
||||||
//set chat history
|
//set chat history
|
||||||
setChatHistory((_) => {
|
setChatHistory((_) => {
|
||||||
let newChatHistory: ChatMessageType[] = [];
|
let newChatHistory: ChatMessageType[] = [];
|
||||||
|
|
@ -313,7 +314,7 @@ export default function FormModal({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
// do not add connectWS on dependencies array
|
// do not add connectWS on dependencies array
|
||||||
}, []);
|
}, [open]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue