Skip to content

Commit

Permalink
be explicit about window.sessionStorage
Browse files Browse the repository at this point in the history
  • Loading branch information
patrislav committed Nov 6, 2024
1 parent 4c27ad1 commit 2eb019e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/waas/src/intents/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function isSessionStorageAvailable() {

export function getTimeDrift() {
if (isSessionStorageAvailable()) {
const drift = sessionStorage.getItem(timeDriftKey)
const drift = window.sessionStorage.getItem(timeDriftKey)
if (drift) {
return parseInt(drift, 10)
}
Expand All @@ -31,7 +31,7 @@ export function getTimeDrift() {
export function updateTimeDrift(serverTime: Date) {
timeDrift = (Date.now() - serverTime.getTime()) / 1000
if (isSessionStorageAvailable()) {
sessionStorage.setItem(timeDriftKey, timeDrift.toString(10))
window.sessionStorage.setItem(timeDriftKey, timeDrift.toString(10))
}
}

Expand Down

0 comments on commit 2eb019e

Please sign in to comment.