mirror of
https://github.com/Foundry376/Mailspring.git
synced 2025-09-08 13:44:53 +08:00
fix(T3474): After authentication when main window already visible, close onboarding window
Summary: Fixes T3474 Test Plan: Run tests Reviewers: dillon, evan Reviewed By: dillon, evan Maniphest Tasks: T3474 Differential Revision: https://phab.nylas.com/D1967
This commit is contained in:
parent
d7c2ce6319
commit
0ea3dfca62
4 changed files with 9 additions and 11 deletions
|
@ -172,7 +172,7 @@ class Application
|
|||
|
||||
_loginSuccessful: =>
|
||||
@openWindowsForTokenState()
|
||||
@windowManager.mainWindow().once 'window:loaded', =>
|
||||
@windowManager.mainWindow().waitForLoad =>
|
||||
@windowManager.onboardingWindow()?.close()
|
||||
|
||||
databasePhase: ->
|
||||
|
|
|
@ -199,11 +199,8 @@ class AtomWindow
|
|||
@browserWindow.focusOnWebView() unless @isWindowClosing
|
||||
|
||||
sendMessage: (message, detail) ->
|
||||
if @loaded
|
||||
@waitForLoad =>
|
||||
@browserWindow.webContents.send(message, detail)
|
||||
else
|
||||
@browserWindow.once 'window:loaded', =>
|
||||
@browserWindow.webContents.send(message, detail)
|
||||
|
||||
sendCommand: (command, args...) ->
|
||||
if @isSpecWindow()
|
||||
|
@ -233,13 +230,15 @@ class AtomWindow
|
|||
show: -> @browserWindow.show()
|
||||
|
||||
showWhenLoaded: ->
|
||||
if @loaded
|
||||
@waitForLoad =>
|
||||
@show()
|
||||
@focus()
|
||||
|
||||
waitForLoad: (fn) ->
|
||||
if @loaded
|
||||
fn()
|
||||
else
|
||||
@once 'window:loaded', =>
|
||||
@show()
|
||||
@focus()
|
||||
@once('window:loaded', fn)
|
||||
|
||||
focus: -> @browserWindow.focus()
|
||||
|
||||
|
|
|
@ -62,8 +62,6 @@ class WindowManager
|
|||
@_mainWindow.focus()
|
||||
else if !@_mainWindow.isVisible()
|
||||
@_mainWindow.showWhenLoaded()
|
||||
else
|
||||
@_mainWindow.focus()
|
||||
|
||||
else
|
||||
if @devMode
|
||||
|
|
|
@ -81,6 +81,7 @@ class EdgehillAPI
|
|||
if token.provider is 'inbox'
|
||||
token.provider = 'nylas'
|
||||
atom.config.set('tokens', incoming)
|
||||
atom.config.save()
|
||||
|
||||
unlinkToken: (token) ->
|
||||
@request
|
||||
|
|
Loading…
Add table
Reference in a new issue