 ]
 
 exports.openDevTools = () ->
-  if mainWindow?
-    mainWindow.webContents.openDevTools()
+  if _mainWindow?
+    _mainWindow.webContents.openDevTools()
 
 ###*
  @callback onInputEndListener

  if debug
    require('electron-debug')({ showDevTools: true })

# prevent window being garbage collected
mainWindow = undefined

LOGIN = "login"
BOUND = "bound"
PROXY_AUTH = "proxy_auth"
DEFAULT_BOUNDS = { width: 250, height: 550 }

_bound = {}
_event = {}
_triedSavedAccount = false

###*
 On closed listener.

{ autoUpdater } = require("electron-auto-updater")
isDev = require('electron-is-dev')
storage = require('electron-json-storage')


if isDev
  # adds debug features like hotkeys for triggering dev tools and reload
