From 7b5c057da62171d0aadea983fef668ef43a49c21 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 5 Dec 2017 20:57:39 +0100 Subject: [PATCH] fix: view.vue-config (cannot send empty messages; empty means if trimmed message has a length of 0) --- view/vue-config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 ]); } });