     if hasToken
       @showMainWindow()
     else
+      onboarding = @onboardingWindow() ? @newOnboardingWindow()
+      onboarding.showWhenLoaded()
+
       @closeMainWindow()
-      @showOnboardingWindow()
+      @unregisterAllHotWindows()
+      for win in @_windows
+        win.close() unless win is onboarding
 
   windows: ->
     @_windows

      console.log unsupported

    if options.coldStart or not @_hotWindows[options.windowType]?
      @newColdWindow(options)
    else
      @newHotWindow(options)
    return

  # This sets up some windows in the background with the requested
  # packages already pre-loaded into it.

    @_hotWindows[windowType].windowPackages ?= (windowPackages ? [])

    @_replenishHotWindows()

  unregisterAllHotWindows: ->
    for type, {loadedWindows} of @_hotWindows
      for win in loadedWindows
        win.close()
    @_replenishQueue = []
    @_hotWindows = {}

  defaultWindowOptions: ->
    devMode: @devMode
