diff --git a/view/vue-config.js b/view/vue-config.js index b1277c1..bbb5c02 100644 --- a/view/vue-config.js +++ b/view/vue-config.js @@ -74,10 +74,15 @@ gstore.add('func', { }, toggleMenuSize: function(){ gstore.data.min_menu=!gstore.data.min_menu; }, 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})); - /* (2) Add locally */ + /* (3) Add locally */ gstore.data.notif[1].data.push([ gstore.data.server.session.name, msg ]); } });