diff --git a/src/popup/app/current/currentController.js b/src/popup/app/current/currentController.js index e8c09119a47..9d28d5c8a71 100644 --- a/src/popup/app/current/currentController.js +++ b/src/popup/app/current/currentController.js @@ -106,6 +106,11 @@ angular }); }; + $scope.sortUriMatch = function(login) { + // exact matches should sort earlier. + return url && url.startsWith(login.uri) ? 0 : 1; + } + $scope.$on('syncCompleted', function (event, successfully) { if ($scope.loaded) { setTimeout(loadVault, 500); diff --git a/src/popup/app/current/views/current.html b/src/popup/app/current/views/current.html index 03730af8ffe..da6bcb980bf 100644 --- a/src/popup/app/current/views/current.html +++ b/src/popup/app/current/views/current.html @@ -10,7 +10,7 @@
+ ng-repeat="login in theLogins = (logins | orderBy: [sortUriMatch, 'name', 'username']) track by $index">