diff options
author | elijah <elijah@riseup.net> | 2017-02-24 20:35:24 -0800 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2017-02-24 20:35:48 -0800 |
commit | 1a9968c1e2592be5baae4bf2c6551ad7f5228f17 (patch) | |
tree | 6b1c254626e9dc7240858e73f7d9cb2e1232512a /ui/app/app.js | |
parent | 904e99c658e647a1c9acbb80a1f54c593a57bf61 (diff) |
[bug] update UI to use current API
Diffstat (limited to 'ui/app/app.js')
-rw-r--r-- | ui/app/app.js | 34 |
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) { |