   # slug: [slug|id|name]
   open: (type, slug) ->
 
-    {socialapi, router, notificationController, mainView} = KD.singletons
+    {socialapi, router, notificationController} = KD.singletons
+
 
     kallback = (data) =>
-
       name = if slug then "#{type}-#{slug}" else type
       pane = @tabs.getPaneByName name
 

    # @addSubView @groupHeader  unless isKoding()
    # @addSubView @sidebar
    { mainView } = KD.singletons
    mainView.ready =>
      @sidebar     = mainView.activitySidebar

    @addSubView @tabs



      then @tabs.showPane pane
      else @createTab name, data

    @sidebar.selectItemByRouteOptions type, slug
    item = @sidebar.selectedItem

    if not item
      type_ = switch type
        when 'message' then 'privatemessage'
        when 'post'    then 'activity'
        else type

      socialapi.cacheable type_, slug, (err, data) =>
        if err then router.handleNotFound router.getCurrentPath()
        else
          @sidebar.addItem data
          kallback data

    else
      kallback item.getData()


  openNext: ->
