mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 02:56:50 +02:00
Merge pull request #846 from kasenvr/fix/domain-server-create-id
Fix domain-server settings "Create new domain ID" dialog.
This commit is contained in:
commit
66ccfab9c9
1 changed files with 46 additions and 31 deletions
|
@ -375,7 +375,7 @@ $(document).ready(function(){
|
|||
}
|
||||
} else {
|
||||
// we're going to change the alert to a new one with a spinner while we create this domain
|
||||
showSpinnerAlert('Creating domain ID');
|
||||
// showSpinnerAlert('Creating domain ID');
|
||||
createNewDomainID(inputValue, justConnected);
|
||||
}
|
||||
});
|
||||
|
@ -388,6 +388,11 @@ $(document).ready(function(){
|
|||
}
|
||||
|
||||
$.post("/api/domains", domainJSON, function(data) {
|
||||
if (data.status === "failure") {
|
||||
failedToCreateDomainID(data, justConnected);
|
||||
return;
|
||||
}
|
||||
|
||||
// we successfully created a domain ID, set it on that field
|
||||
var domainID = data.domain.domainId;
|
||||
console.log("Setting domain id to ", data, domainID);
|
||||
|
@ -411,10 +416,21 @@ $(document).ready(function(){
|
|||
}, function () {
|
||||
saveSettings();
|
||||
});
|
||||
}, 'json').fail(function(){
|
||||
}, 'json').fail(function (data) {
|
||||
failedToCreateDomainID(data, justConnected);
|
||||
});
|
||||
}
|
||||
|
||||
function failedToCreateDomainID(data, justConnected) {
|
||||
var errorText = "There was a problem creating your new domain ID. Do you want to try again or";
|
||||
|
||||
if (data && data.status === "failure") {
|
||||
errorText = "Error: " + data.error + "</br>Do you want to try again or";
|
||||
console.log("Error: " + data.error);
|
||||
} else {
|
||||
console.log("Error: Failed to post to metaverse.");
|
||||
}
|
||||
|
||||
if (justConnected) {
|
||||
errorText += " just save your new access token?</br></br>You can always create a new domain ID later.";
|
||||
} else {
|
||||
|
@ -442,7 +458,6 @@ $(document).ready(function(){
|
|||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function createDomainSpinner() {
|
||||
|
|
Loading…
Reference in a new issue