mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-02-25 08:35:16 +08:00
20 lines
580 B
JavaScript
20 lines
580 B
JavaScript
/* eslint import/first: 0 */
|
|
|
|
// Extend the standard promise class a bit
|
|
import './promise-extensions';
|
|
|
|
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);
|