Skip to content

Commit

Permalink
initialize empty arr for getOldestParsedCertificate
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkabuki committed Nov 30, 2023
1 parent a1fe675 commit b133b51
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/state-manager/src/sagas/users/users.selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export const getUserByPubKey = (pubKey: string) => createSelector(allUsers, user
export const getOldestParsedCerificate = createSelector(certificates, certs => {
const getTimestamp = (cert: Certificate) => new Date(cert.notBefore.value).getTime()

const certificates: [string, Certificate][] =
let certificates: [string, Certificate][] = []

certificates =
Array.from(Object.entries(certs))
.sort((a, b) => {
const aTimestamp = getTimestamp(a[1])
Expand Down

0 comments on commit b133b51

Please sign in to comment.