 
     buttons['Remove ' + SettingsHelper.get('current_core_name')] = =>
       workspace = atom.workspaceView
-      ApiClient = require './vendor/ApiClient'
+      ApiClient ?= require './vendor/ApiClient'
       client = new ApiClient SettingsHelper.get('apiUrl'), SettingsHelper.get('access_token')
       @removePromise = client.removeCore SettingsHelper.get('current_core')
       @removePromise.done (e) =>


    promise = SerialHelper.listPorts()
    promise.done (ports) =>
      console.log ports
      if ports.length == 0
        @listeningModeView = new ListeningModeView()
        @listeningModeView.show()
      else if (ports.length == 1) || (!!port)
        # TODO: Only one core or it was selected
        if !port
          port = ports[0].comName

        console.log 'Will claim core on port ' + port
      else
        # TODO: Show list with cores
        SelectPortView ?= require './views/select-port-view'
        @selectPortView ?= new SelectPortView()


ClaimCoreManuallyView = null
ListeningModeView = null
SelectPortView = null
ApiClient = null

module.exports =
  statusView: null
