1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-10-15 06:47:57 +02:00

sort fixes when never used

This commit is contained in:
Kyle Spearrin 2017-08-29 13:03:08 -04:00
parent 518585cfb5
commit e01f3fd40c

View File

@ -501,13 +501,20 @@ function initLoginService() {
var aLastUsed = a.localData && a.localData.lastUsedDate ? a.localData.lastUsedDate : null;
var bLastUsed = b.localData && b.localData.lastUsedDate ? b.localData.lastUsedDate : null;
if (aLastUsed && (!bLastUsed || aLastUsed < bLastUsed)) {
if (aLastUsed && bLastUsed && aLastUsed < bLastUsed) {
return 1;
}
if (bLastUsed && (!aLastUsed || aLastUsed > bLastUsed)) {
if (aLastUsed && !bLastUsed) {
return -1;
}
if (bLastUsed && aLastUsed && aLastUsed > bLastUsed) {
return -1;
}
if (bLastUsed && !aLastUsed) {
return 1;
}
return 0;
};