Skip to content

Commit

Permalink
fix: Do not include ms in time calculations (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
unfunco authored Feb 12, 2024
1 parent 7227b6e commit a967cc9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/bg/gc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ export const gc = async (ms?: number): Promise<NodeJS.Timeout> => {
credentials: AWSCredentials
}

if (stored.credentials._expiry < Date.now()) {
const expiry = stored.credentials._expiry / 1000
const now = Math.floor(Date.now() / 1000)

if (now >= expiry) {
await Browser.storage.local.remove('credentials')
}

Expand Down

0 comments on commit a967cc9

Please sign in to comment.