mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-14 13:44:41 +08:00
e44a7e28b6
Summary: Add spinner and refactor container view to be router add `NylasStore` as a global importable. specs for APIEnv login page fixes add old fixes to container view finish extracting pages fix onboarding flow Test Plan: edgehill --test Reviewers: bengotow Reviewed By: bengotow Differential Revision: https://phab.nylas.com/D1652
18 lines
619 B
CoffeeScript
18 lines
619 B
CoffeeScript
Actions = require './onboarding-actions'
|
|
NylasStore = require 'nylas-store'
|
|
|
|
class NylasApiEnvironmentStore extends NylasStore
|
|
constructor: ->
|
|
@listenTo Actions.changeAPIEnvironment, @_setEnvironment
|
|
|
|
defaultEnv = if atom.inDevMode() then 'staging' else 'staging'
|
|
@_setEnvironment(defaultEnv) unless atom.config.get('env')
|
|
|
|
getEnvironment: -> atom.config.get('env')
|
|
|
|
_setEnvironment: (env) ->
|
|
throw new Error("Environment #{env} is not allowed") unless env in ['development', 'staging', 'production']
|
|
atom.config.set('env', env)
|
|
@trigger()
|
|
|
|
module.exports = new NylasApiEnvironmentStore()
|