From 1a9968c1e2592be5baae4bf2c6551ad7f5228f17 Mon Sep 17 00:00:00 2001 From: elijah Date: Fri, 24 Feb 2017 20:35:24 -0800 Subject: [bug] update UI to use current API --- ui/app/app.js | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'ui/app/app.js') 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) { -- cgit v1.2.3