From 9d301349ab434dc744546918fe026d50485a0797 Mon Sep 17 00:00:00 2001 From: elijah Date: Mon, 24 Apr 2017 00:53:41 -0700 Subject: [feat] usable vpn ui --- ui/app/app.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'ui/app/app.js') diff --git a/ui/app/app.js b/ui/app/app.js index ea7f0f52..fe1cc47d 100644 --- a/ui/app/app.js +++ b/ui/app/app.js @@ -2,6 +2,9 @@ import bitmask from 'lib/bitmask' import Account from 'models/account' import Provider from 'models/provider' +require('css/bootstrap.less') +require('css/common.less') + class Application { constructor() { } @@ -15,6 +18,13 @@ class Application { this.start() } + // + // (1) check to see if any accounts are authenticated. + // if any are, show main panel + // (2) check to see if any accounts are 'vpn ready'. + // if any are, show main panel. + // (3) otherwise, show login greeter + // start() { Provider.list(false).then( domains => { @@ -22,7 +32,13 @@ class Application { Account.active().then( accounts => { if (0 == accounts.length) { - this.show('greeter') + Account.vpnReady().then(accounts => { + if (0 == accounts.length) { + this.show('greeter', {showLogin: true}) + } else { + this.show('main', {initialAccount: accounts[0]}) + } + }) } else { accounts.forEach(account => { Account.addActive(account) -- cgit v1.2.3