From 629df98a3684277867e9c4c957eb479284fdf4c9 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 7 Dec 2017 20:02:27 +0100 Subject: [PATCH] upd: vue.container.emergency (fix message send) --- view/vue/container/emergency.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/view/vue/container/emergency.vue b/view/vue/container/emergency.vue index 89fea23..0eed64c 100644 --- a/view/vue/container/emergency.vue +++ b/view/vue/container/emergency.vue @@ -46,11 +46,19 @@ export default { }, new_message(msg){ - // {1} Send message // - this.gstore.func.sendMessage(this.gstore.new_msg.emergency, wsc_emergency); + /* (1) If empty message -> abort */ + if( msg.trim().length == 0 ) + return; - // {2} Empty input // + /* (2) Send message to WebSocket */ + ws_emergency.send(JSON.stringify({message: msg, location: [1.1, 2.2]})); + + /* (3) Add loader */ + gstore.data.msg_pending.inbox = true; + + /* (4) Empty input */ this.gstore.new_msg.emergency = ''; + }, bbcode: function(msg){