[client-app] Convert nylas-env.coffee to ES6 😓

Test Plan: unit tests + run the app

Reviewers: juan, halla, evan

Reviewed By: evan

Differential Revision: https://phab.nylas.com/D3979
This commit is contained in:
Christine Spang 2017-02-21 12:37:54 -08:00
parent 15bcf974d2
commit 776cf26d7a
4 changed files with 1250 additions and 1031 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,19 +0,0 @@
# Swap out Node's native Promise for Bluebird, which allows us to
# do fancy things like handle exceptions inside promise blocks
global.Promise = require 'bluebird'
Promise.setScheduler(global.setImmediate)
# Like sands through the hourglass, so are the days of our lives.
require './window'
NylasEnvConstructor = require './nylas-env'
window.NylasEnv = window.atom = NylasEnvConstructor.loadOrCreate()
NylasEnv.initialize()
NylasEnv.startRootWindow()
# Workaround for focus getting cleared upon window creation
windowFocused = ->
window.removeEventListener('focus', windowFocused)
setTimeout (-> document.getElementById('sheet-container')?.focus()), 0
window.addEventListener('focus', windowFocused)

View file

@ -0,0 +1,25 @@
/* eslint import/first: 0 */
// Swap out Node's native Promise for Bluebird, which allows us to
// do fancy things like handle exceptions inside promise blocks
global.Promise = require('bluebird');
Promise.setScheduler(global.setImmediate);
// Like sands through the hourglass, so are the days of our lives.
import './window';
import NylasEnvConstructor from './nylas-env';
window.NylasEnv = NylasEnvConstructor.loadOrCreate();
NylasEnv.initialize();
NylasEnv.startRootWindow();
// Workaround for focus getting cleared upon window creation
const windowFocused = () => {
window.removeEventListener('focus', windowFocused);
return setTimeout((() => {
const elt = document.getElementById('sheet-container');
if (elt) elt.focus();
}), 0);
}
window.addEventListener('focus', windowFocused);