summaryrefslogtreecommitdiff
path: root/ui/app/app.js
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2017-04-24 00:53:41 -0700
committerKali Kaneko (leap communications) <kali@leap.se>2017-04-24 11:12:26 +0200
commit9d301349ab434dc744546918fe026d50485a0797 (patch)
tree802bec24bb446c9ed3af11f7ccfcd9793250b070 /ui/app/app.js
parent2976cf11e451f1086d98eae20bdfb0fffa87abb0 (diff)
[feat] usable vpn ui
Diffstat (limited to 'ui/app/app.js')
-rw-r--r--ui/app/app.js18
1 files changed, 17 insertions, 1 deletions
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)