From 08e4929af20ce8f3ad54693b72a6068df7bfc7c0 Mon Sep 17 00:00:00 2001 From: Hexagon Date: Sun, 21 Sep 2014 13:17:25 +0200 Subject: [PATCH] Clear input field when unable to send message --- public/js/cryptalk_modules/cryptalk.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/js/cryptalk_modules/cryptalk.js b/public/js/cryptalk_modules/cryptalk.js index a967579..2f2417c 100644 --- a/public/js/cryptalk_modules/cryptalk.js +++ b/public/js/cryptalk_modules/cryptalk.js @@ -159,13 +159,16 @@ define('cryptalk', { components.input[0].value = ''; } else /* Handle ordinary message */ { - // Make sure that the users has joined a room + + // Make sure that the user has joined a room if (!room) { + components.input[0].value = ''; return post('error', templates.messages.msg_no_room); } // And that a valid key is set if (!key) { + components.input[0].value = ''; return post('error', templates.messages.msg_no_key); }