fix(focus): Focusing quickly enough can throw. Sentry #14942

This commit is contained in:
Ben Gotow 2016-02-26 10:55:31 -08:00
parent 7d92f72552
commit 24ca99e925

View file

@ -16,5 +16,5 @@ NylasEnv.startRootWindow()
# Workaround for focus getting cleared upon window creation
windowFocused = ->
window.removeEventListener('focus', windowFocused)
setTimeout (-> document.getElementById('sheet-container').focus()), 0
setTimeout (-> document.getElementById('sheet-container')?.focus()), 0
window.addEventListener('focus', windowFocused)