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