   init: ->
 
     @connect()  unless @_connectAttempted
-
-    if @terminalSessions.length is 0 and not @_fetchingSessions
-    then @fetchTerminalSessions()
-    else Promise.resolve()
+    Promise.resolve()
 
 
   # setTransport is used to override the setTransport method in KodingKite


      .then (state) =>

        @terminalSessions = @terminalSessions.filter (currentSession)->
          session isnt currentSession

        return state


  fetchTerminalSessions: ->

    @_fetchingSessions = yes


    .catch (err)=>

      # Reset current sessions if fails
      if err.message is 'no sessions available'
        @terminalSessions = if session then [session] else []
      else
        @terminalSessions = []

      @_fetchingSessions = no

      @syncSessionsWithLocalStorage()



  getLocalStorage = ->

    return KD.singletons.localStorageController.storage 'Klient', '1.0'

  setActiveSessions = (sessions)->

    getLocalStorage().setValue 'activeSessions', sessions


  getActiveSessions: ->

    return (getLocalStorage().getValue 'activeSessions') ? []


  syncSessionsWithLocalStorage: ->

    setActiveSessions @getActiveSessions().filter (session)=>
      session in @terminalSessions


  addToActiveSessions: (session)->

    activeSessions = @getActiveSessions()
    activeSessions.push session  unless session in activeSessions

    setActiveSessions activeSessions


  removeFromActiveSessions: (session)->

    activeSessions = @getActiveSessions().filter (old)-> session isnt old

    setActiveSessions activeSessions
