mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 06:29:30 +02:00
handle domain ID removal and account disconnection
This commit is contained in:
parent
a675b0a891
commit
bfa069a26b
1 changed files with 6 additions and 14 deletions
|
@ -22,7 +22,8 @@ var Settings = {
|
||||||
CONNECT_ACCOUNT_BTN_ID: 'connect-account-btn',
|
CONNECT_ACCOUNT_BTN_ID: 'connect-account-btn',
|
||||||
DISCONNECT_ACCOUNT_BTN_ID: 'disconnect-account-btn',
|
DISCONNECT_ACCOUNT_BTN_ID: 'disconnect-account-btn',
|
||||||
CREATE_DOMAIN_ID_BTN_ID: 'create-domain-btn',
|
CREATE_DOMAIN_ID_BTN_ID: 'create-domain-btn',
|
||||||
CHOOSE_DOMAIN_ID_BTN_ID: 'choose-domain-btn'
|
CHOOSE_DOMAIN_ID_BTN_ID: 'choose-domain-btn',
|
||||||
|
ACCESS_TOKEN_SELECTOR: '[name="metaverse.access_token"]'
|
||||||
};
|
};
|
||||||
|
|
||||||
var viewHelpers = {
|
var viewHelpers = {
|
||||||
|
@ -286,16 +287,6 @@ function setupHFAccountButton() {
|
||||||
$('#metaverse .panel-body').prepend(buttonGroup);
|
$('#metaverse .panel-body').prepend(buttonGroup);
|
||||||
}
|
}
|
||||||
|
|
||||||
function postNewAccessToken(access_token) {
|
|
||||||
var newAccessToken = {
|
|
||||||
"metaverse": {
|
|
||||||
"access_token": access_token
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
postSettings(newAccessToken);
|
|
||||||
}
|
|
||||||
|
|
||||||
function disonnectHighFidelityAccount() {
|
function disonnectHighFidelityAccount() {
|
||||||
// the user clicked on the disconnect account btn - give them a sweet alert to make sure this is what they want to do
|
// the user clicked on the disconnect account btn - give them a sweet alert to make sure this is what they want to do
|
||||||
swal({
|
swal({
|
||||||
|
@ -307,7 +298,8 @@ function disonnectHighFidelityAccount() {
|
||||||
showCancelButton: true,
|
showCancelButton: true,
|
||||||
}, function(){
|
}, function(){
|
||||||
// we need to post to settings to clear the access-token
|
// we need to post to settings to clear the access-token
|
||||||
postNewAccessToken("");
|
$(Settings.ACCESS_TOKEN_SELECTOR).val('').change();
|
||||||
|
saveSettings();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,7 +321,7 @@ function prepareAccessTokenPrompt() {
|
||||||
}
|
}
|
||||||
|
|
||||||
// we have an input value - set the access token input with this and save settings
|
// we have an input value - set the access token input with this and save settings
|
||||||
$("[name='metaverse.access_token']").val(inputValue).change();
|
$(Settings.ACCESS_TOKEN_SELECTOR).val(inputValue).change();
|
||||||
|
|
||||||
// if the user doesn't have a domain ID set, give them the option to create one now
|
// if the user doesn't have a domain ID set, give them the option to create one now
|
||||||
if (!Settings.data.values.metaverse.id) {
|
if (!Settings.data.values.metaverse.id) {
|
||||||
|
@ -404,7 +396,7 @@ function createNewDomainID(description, justConnected) {
|
||||||
"domain": {
|
"domain": {
|
||||||
"description": description
|
"description": description
|
||||||
},
|
},
|
||||||
"access_token": $("[name='metaverse.access_token']").val()
|
"access_token": $(Settings.ACCESS_TOKEN_SELECTOR).val()
|
||||||
}
|
}
|
||||||
|
|
||||||
$.post(Settings.METAVERSE_URL + "/api/v1/domains", domainJSON, function(data){
|
$.post(Settings.METAVERSE_URL + "/api/v1/domains", domainJSON, function(data){
|
||||||
|
|
Loading…
Reference in a new issue