fix(analytics): delay closing of onboarding window

This commit is contained in:
Evan Morikawa 2016-02-12 10:56:36 -08:00
parent 0f9475cc91
commit 280015b5c0
2 changed files with 9 additions and 1 deletions

View file

@ -32,7 +32,14 @@ class PageRouterStore extends NylasStore
@_onMoveToPage('initial-preferences', {account: json})
Actions.recordUserEvent('First Account Linked')
else
# When account JSON is received, we want to notify external services
# that it succeeded. Unfortunately in this case we're likely to
# close the window before those requests can be made. We add a short
# delay here to ensure that any pending requests have a chance to
# clear before the window closes.
setTimeout ->
ipcRenderer.send('account-setup-successful')
, 100
_onWindowPropsChanged: ({page, pageData}={}) =>
@_onMoveToPage(page, pageData)

View file

@ -42,6 +42,7 @@ class SearchSuggestionStore extends NylasStore
current = FocusedPerspectiveStore.current()
if @queryPopulated()
Actions.recordUserEvent("Commit Search Query", {})
@_perspectiveBeforeSearch ?= current
next = MailboxPerspective.forSearch(current.accountIds, @_searchQuery.trim())
Actions.focusMailboxPerspective(next)