2017-02-22 04:37:54 +08:00
|
|
|
/* eslint import/first: 0 */
|
|
|
|
|
2017-07-11 01:26:27 +08:00
|
|
|
// Extend the standard promise class a bit
|
|
|
|
import './promise-extensions';
|
2017-02-22 04:37:54 +08:00
|
|
|
|
|
|
|
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);
|