mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 20:29:35 +02:00
Add if check for soket
This commit is contained in:
@@ -16,7 +16,11 @@ export function ConnectToChat() {
|
||||
|
||||
webSocket.onmessage = function (event) {
|
||||
|
||||
eventBus.emit('dataChat', event.data)
|
||||
const dataObject = JSON.parse(event.data);
|
||||
|
||||
if (dataObject && dataObject.hasOwnProperty('SpUserName') && dataObject.hasOwnProperty('Message')) {
|
||||
eventBus.emit('dataChat', dataObject);
|
||||
}
|
||||
|
||||
console.log('Message from Server:', event.data);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user