mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-01-06 08:08:10 +08:00
7ba1e0c4a6
We were somehow falling into a bluebird case where it uses a DOMMutationObserver instead of nextTick. We should probably report this to them.
23 lines
889 B
CoffeeScript
23 lines
889 B
CoffeeScript
# 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'
|
|
|
|
# Skip "?loadSettings=".
|
|
# loadSettings = JSON.parse(decodeURIComponent(location.search.substr(14)))
|
|
# {windowType} = loadSettings
|
|
|
|
NylasEnvConstructor = require './nylas-env'
|
|
window.NylasEnv = window.atom = NylasEnvConstructor.loadOrCreate()
|
|
global.Promise.longStackTraces() if NylasEnv.inDevMode()
|
|
NylasEnv.initialize()
|
|
NylasEnv.startSecondaryWindow()
|
|
|
|
# Workaround for focus getting cleared upon window creation
|
|
windowFocused = ->
|
|
window.removeEventListener('focus', windowFocused)
|
|
setTimeout (-> document.querySelector('body').focus()), 0
|
|
window.addEventListener('focus', windowFocused)
|