From 926e87c6fe046557ed3a9e1c0c1bfdbd5f3f68c5 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 29 Aug 2017 13:15:27 -0400 Subject: [PATCH] sort current tab by last used --- src/popup/app/current/currentController.js | 4 ++++ src/popup/app/current/views/current.html | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/popup/app/current/currentController.js b/src/popup/app/current/currentController.js index d2eb7d3454..f3651656f4 100644 --- a/src/popup/app/current/currentController.js +++ b/src/popup/app/current/currentController.js @@ -94,6 +94,10 @@ angular return url && url.startsWith(login.uri) ? 0 : 1; }; + $scope.sortLastUsed = function (login) { + return login.localData && login.localData.lastUsedDate ? -1 * login.localData.lastUsedDate : 0; + }; + $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 94485e9964..602ba7a5ec 100644 --- a/src/popup/app/current/views/current.html +++ b/src/popup/app/current/views/current.html @@ -10,7 +10,8 @@
+ ng-repeat="login in theLogins = (logins | orderBy: [sortUriMatch, sortLastUsed, 'name', 'username']) + track by $index">