mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-01 12:33:31 +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
parent
1948ba2cc3
commit
89d1344e2f
@@ -43,11 +43,13 @@ class NewServerForm extends BaseComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
submitFormHandler() {
|
submitFormHandler() {
|
||||||
|
this.$saveServerButton.children[1].innerHTML = 'Adding...';
|
||||||
DomainUtil.checkDomain(this.$newServerUrl.value).then(serverConf => {
|
DomainUtil.checkDomain(this.$newServerUrl.value).then(serverConf => {
|
||||||
DomainUtil.addDomain(serverConf).then(() => {
|
DomainUtil.addDomain(serverConf).then(() => {
|
||||||
this.props.onChange(this.props.index);
|
this.props.onChange(this.props.index);
|
||||||
});
|
});
|
||||||
}, errorMessage => {
|
}, errorMessage => {
|
||||||
|
this.$saveServerButton.children[1].innerHTML = 'Add';
|
||||||
alert(errorMessage);
|
alert(errorMessage);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,8 +99,7 @@ class DomainUtil {
|
|||||||
checkDomain(domain, silent = false) {
|
checkDomain(domain, silent = false) {
|
||||||
if (!silent && this.duplicateDomain(domain)) {
|
if (!silent && this.duplicateDomain(domain)) {
|
||||||
// Do not check duplicate in silent mode
|
// Do not check duplicate in silent mode
|
||||||
alert('This server has been added.');
|
return Promise.reject('This server has been added.');
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
domain = this.formatUrl(domain);
|
domain = this.formatUrl(domain);
|
||||||
|
|||||||
Reference in New Issue
Block a user