Clear input field when unable to send message

This commit is contained in:
Hexagon 2014-09-21 13:17:25 +02:00
parent ca4385963d
commit 08e4929af2
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}