Clear input field when unable to send message
This commit is contained in:
		
							parent
							
								
									ca4385963d
								
							
						
					
					
						commit
						08e4929af2
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		| 
						 | 
					@ -159,13 +159,16 @@ define('cryptalk', {
 | 
				
			||||||
				components.input[0].value = '';
 | 
									components.input[0].value = '';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
			} else /* Handle ordinary message */ {
 | 
								} else /* Handle ordinary message */ {
 | 
				
			||||||
				// Make sure that the users has joined a room
 | 
					
 | 
				
			||||||
 | 
									// Make sure that the user has joined a room
 | 
				
			||||||
				if (!room) {
 | 
									if (!room) {
 | 
				
			||||||
 | 
										components.input[0].value = '';
 | 
				
			||||||
					return post('error', templates.messages.msg_no_room);
 | 
										return post('error', templates.messages.msg_no_room);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
				// And that a valid key is set
 | 
									// And that a valid key is set
 | 
				
			||||||
				if (!key) {
 | 
									if (!key) {
 | 
				
			||||||
 | 
										components.input[0].value = '';
 | 
				
			||||||
					return post('error', templates.messages.msg_no_key);
 | 
										return post('error', templates.messages.msg_no_key);
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue