     $scope.packageVisible = {}
     $scope.packageSelected = {}
     $scope.packageFetching = {}
-    $scope.repoSelected = null
+    $scope.repoSelected = {}
     $scope.repoSelectedLabel = null
     $scope.newRepos = []
     $scope.editingRepo = {}

    $scope.repoLabels = ()->
      _.uniq( $scope.repos.map((x) -> x.label) )

    $scope.selectRepo = (m)->
      if m? and m.id?
        if $scope.repoSelected? and $scope.repoSelected.id is m.id
          console.log "deselect repos"
          $scope.repoSelected = null
        else
          console.log("repo #{m.name} (#{m.id}) selected")
          $scope.repoSelected = m
        # deselect repo selection by Label
        $scope.repoSelectedLabel = null
      else
        console.log("repo deselected")
        $scope.repoSelected = null
        $scope.repoSelectedLabel = null
      # update the list of packages with the selected repo
      $scope.fetchPackages()

      $scope.allPackagesMap = {}

      # If a repo was selected, filter by it
      if $scope.repoSelectedIds().length isnt 0
        query = { 'outdated':true, 'repo': $scope.repoSelectedIds().join(",") }
      else if $scope.repoSelectedLabel?
        query = { 'outdated':true, 'repolabel': $scope.repoSelectedLabel }
      else
