fix: view.vue-config (cannot send empty messages; empty means if trimmed message has a length of 0)
This commit is contained in:
parent
49b4e0a914
commit
7b5c057da6
|
@ -74,10 +74,15 @@ gstore.add('func', {
|
||||||
},
|
},
|
||||||
toggleMenuSize: function(){ gstore.data.min_menu=!gstore.data.min_menu; },
|
toggleMenuSize: function(){ gstore.data.min_menu=!gstore.data.min_menu; },
|
||||||
sendMessage: function(msg){
|
sendMessage: function(msg){
|
||||||
/* (1) Send message to WebSocket */
|
/* (1) If empty message -> abort */
|
||||||
|
if( msg.trim().length == 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
/* (2) Send message to WebSocket */
|
||||||
wsc_chat.send(JSON.stringify({message: msg}));
|
wsc_chat.send(JSON.stringify({message: msg}));
|
||||||
|
|
||||||
/* (2) Add locally */
|
/* (3) Add locally */
|
||||||
gstore.data.notif[1].data.push([ gstore.data.server.session.name, msg ]);
|
gstore.data.notif[1].data.push([ gstore.data.server.session.name, msg ]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue