mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-10-30 11:33:36 +00:00 
			
		
		
		
	preference page: Add a Loading indication for new server button. (#401)
Change the text of "Add" button to "Adding..." when a user clicks on Add button for adding new server. Fixes: #396.
This commit is contained in:
		
				
					committed by
					
						 Akash Nimare
						Akash Nimare
					
				
			
			
				
	
			
			
			
						parent
						
							1948ba2cc3
						
					
				
				
					commit
					89d1344e2f
				
			| @@ -43,11 +43,13 @@ class NewServerForm extends BaseComponent { | ||||
| 	} | ||||
|  | ||||
| 	submitFormHandler() { | ||||
| 		this.$saveServerButton.children[1].innerHTML = 'Adding...'; | ||||
| 		DomainUtil.checkDomain(this.$newServerUrl.value).then(serverConf => { | ||||
| 			DomainUtil.addDomain(serverConf).then(() => { | ||||
| 				this.props.onChange(this.props.index); | ||||
| 			}); | ||||
| 		}, errorMessage => { | ||||
| 			this.$saveServerButton.children[1].innerHTML = 'Add'; | ||||
| 			alert(errorMessage); | ||||
| 		}); | ||||
| 	} | ||||
|   | ||||
| @@ -99,8 +99,7 @@ class DomainUtil { | ||||
| 	checkDomain(domain, silent = false) { | ||||
| 		if (!silent && this.duplicateDomain(domain)) { | ||||
| 			// Do not check duplicate in silent mode | ||||
| 			alert('This server has been added.'); | ||||
| 			return; | ||||
| 			return Promise.reject('This server has been added.'); | ||||
| 		} | ||||
|  | ||||
| 		domain = this.formatUrl(domain); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user