Skip to content

Commit 9698848

Browse files
committed
Password Item sorting
1 parent 06afd41 commit 9698848

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/components/vault/vault-page.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,12 @@ export const VaultPage: React.FC<VaultPageProps> = ({ user }) => {
126126
);
127127

128128
setPasswords(
129-
decryptedPasswords.filter(
130-
(item): item is PasswordEntry => item !== null
131-
)
129+
decryptedPasswords
130+
.filter((item): item is PasswordEntry => item !== null)
131+
.sort(
132+
(a, b) =>
133+
new Date(b.created).getTime() - new Date(a.created).getTime()
134+
)
132135
);
133136
};
134137

0 commit comments

Comments
 (0)