/* @flow */

import getenv from 'getenv'

// To enable a feature, include it in the environment variable KEYBASE_FEATURES.
// For example, KEYBASE_FEATURES=tracker2,login,awesomefeature

const adminKey = 'admin'
const loginKey = 'login'
const mobileAppsExistKey = 'mobileAppsExist'

type FeatureFlags = {
  'admin': boolean,
  'dz2': boolean,
  'login': boolean,
  'mobileAppsExist': boolean,
  'tracker2': boolean
}

let features = getenv.array('KEYBASE_FEATURES', 'string', '')

const admin = features.includes(adminKey)
const dz2 = true
const login = features.includes(loginKey)
const mobileAppsExist = features.includes(mobileAppsExistKey)
const tracker2 = true

const ff: FeatureFlags = {
  admin,
  dz2,
  login,
  mobileAppsExist,
  tracker2
}

if (__DEV__) {
  console.log('Features', ff)
}

export default ff
export {
  admin,
  dz2,
  login,
  mobileAppsExist,
  tracker2
}

@@ -322,26 +322,8 @@
 an,%0A
-  'dz2': boolean,%0A
   'l
@@ -338,16 +338,16 @@
 oolean,%0A
+
   'mobil
@@ -502,25 +502,8 @@
 ey)%0A
-const dz2 = true%0A
 cons
@@ -653,39 +653,32 @@
 gs = %7B%0A  admin,%0A
-  dz2,%0A
   login,%0A  mobil
@@ -778,16 +778,16 @@
 xport %7B%0A
+
   admin,
@@ -791,15 +791,8 @@
 in,%0A
-  dz2,%0A
   lo

Remove dz2 feature flag