Skip to content

Commit 1302341

Browse files
Merge branch 'release/core-2' into alexcarpenter/keyless-take-3
2 parents 47c096b + 5196122 commit 1302341

2 files changed

Lines changed: 5 additions & 6 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
---
4+
5+
Removed redundant `beforeunload` event listener from SafeLock that was disabling the browser's back-forward cache (bfcache), degrading navigation performance.

packages/clerk-js/src/core/auth/safeLock.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ import Lock from 'browser-tabs-lock';
33
export function SafeLock(key: string) {
44
const lock = new Lock();
55

6-
// TODO: Figure out how to fix this linting error
7-
// eslint-disable-next-line @typescript-eslint/no-misused-promises
8-
window.addEventListener('beforeunload', async () => {
9-
await lock.releaseLock(key);
10-
});
11-
126
const acquireLockAndRun = async (cb: () => Promise<unknown>) => {
137
if ('locks' in navigator && isSecureContext) {
148
const controller = new AbortController();

0 commit comments

Comments
 (0)