summaryrefslogtreecommitdiff
path: root/ui/app/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/app.js')
-rw-r--r--ui/app/app.js34
1 files changed, 19 insertions, 15 deletions
diff --git a/ui/app/app.js b/ui/app/app.js
index 05dadf1f..ea7f0f52 100644
--- a/ui/app/app.js
+++ b/ui/app/app.js
@@ -16,21 +16,25 @@ class Application {
}
start() {
- Provider.list(false).then(domains => {
- Account.initializeList(domains)
- Account.active().then(account => {
- if (account == null) {
- this.show('greeter')
- } else {
- Account.addPrimary(account)
- this.show('main', {initialAccount: account})
- }
- }, error => {
- this.showError(error)
- })
- }, error => {
- this.showError(error)
- })
+ Provider.list(false).then(
+ domains => {
+ Account.initializeList(domains)
+ Account.active().then(
+ accounts => {
+ if (0 == accounts.length) {
+ this.show('greeter')
+ } else {
+ accounts.forEach(account => {
+ Account.addActive(account)
+ })
+ this.show('main', {initialAccount: Account.list[0]})
+ }
+ },
+ error => {this.showError(error)}
+ )
+ },
+ error => {this.showError(error)}
+ )
}
show(panel, properties) {