       cb(matches, queries)
 
 
+  ###
+   When account added and not selected, update selected account.
+  ###
+  $scope.$on 'accountAdded', (e, account) ->
+    if not $scope.selectedAccount
+      $scope.selectedAccount = $scope.accounts[0]
+
+
+  ###
    remove project and issues.
   ###
   $scope.$on 'accountRemoved', (e, url) ->

  , true)


    $scope.editState.currentPage = 1
    $scope.editState.load()


    highlight: true
    minLength: 0

  # http request canceled.
  STATUS_CANCEL = 0

  # don't use query
  QUERY_ALL_ID = 'All'


  ###
