Skip to content

Commit

Permalink
Merge pull request #5356 from kodadot/fix/clear-local-n-session
Browse files Browse the repository at this point in the history
fix: clear localStorage and sessionStorage
  • Loading branch information
vikiival authored Mar 24, 2023
2 parents 3b70b74 + 588c0ef commit e526c24
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions utils/cachingStrategy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,16 @@ export const flushIndexedDb = () => {

export const clearSession = () => {
try {
window.sessionStorage.clear()
window.localStorage.clear()
flushIndexedDb()
setTimeout(() => {
window.sessionStorage.clear()
window.localStorage.clear()
flushIndexedDb()
}, 100)
} catch (error) {
console.error(error)
} finally {
window.location.reload()
setTimeout(() => {
window.location.reload()
}, 200)
}
}

0 comments on commit e526c24

Please sign in to comment.