v0.0.1-alpha.6 - Finalizing the settings account tab.

Added a done button which closes the settings UI.
Displays a warning before the user logs out of the last saved account. If they proceed with the logout, they will be redirected to the login UI.
Added startup handling for when the user has 0 saved accounts. They will be brought directly to the login UI.
Accounts are now validated each time they are switched.
This commit is contained in:
Daniel Scalzi
2018-05-30 23:32:51 -04:00
parent 91c842dd40
commit 74a60a61c2
6 changed files with 107 additions and 21 deletions

View File

@@ -61,9 +61,11 @@ function showMainUI(){
document.body.style.backgroundImage = `url('assets/images/backgrounds/${document.body.getAttribute('bkid')}.jpg')`
$('#main').show()
const isLoggedIn = Object.keys(ConfigManager.getAuthAccounts()).length > 0
// If this is enabled in a development environment we'll get ratelimited.
// The relaunch frequency is usually far too high.
if(!isDev){
if(!isDev && isLoggedIn){
validateSelectedAccount().then((v) => {
if(v){
console.log('%c[AuthManager]', 'color: #209b07; font-weight: bold', 'Account access token validated.')
@@ -76,7 +78,11 @@ function showMainUI(){
if(ConfigManager.isFirstLaunch()){
$(VIEWS.welcome).fadeIn(1000)
} else {
$(VIEWS.landing).fadeIn(1000)
if(isLoggedIn){
$(VIEWS.landing).fadeIn(1000)
} else {
$(VIEWS.login).fadeIn(1000)
}
}
setTimeout(() => {