diff --git a/view/vue/container/inbox.vue b/view/vue/container/inbox.vue index 21b7852..accf734 100644 --- a/view/vue/container/inbox.vue +++ b/view/vue/container/inbox.vue @@ -9,7 +9,7 @@
-
+
@@ -27,11 +27,19 @@ export default { methods: { new_message(msg){ - // {1} Send message // - this.gstore.func.sendMessage(this.gstore.new_msg.inbox, wsc_chat); + /* (1) If empty message -> abort */ + if( msg.trim().length == 0 ) + return; - // {2} Empty input // + /* (2) Send message to WebSocket */ + wsc_chat.send(JSON.stringify({message: msg})); + + /* (3) Add loader */ + gstore.data.msg_pending.inbox = true; + + /* (4) Empty input */ this.gstore.new_msg.inbox = ''; + }, bbcode: function(msg){