Skip to content

Commit 609d528

Browse files
authored
fix: do not warn about navigator lock when not used (supabase#18287)
1 parent b14f78d commit 609d528

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/common/gotrue.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ const persistedDebug =
1717
process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' &&
1818
globalThis?.localStorage?.getItem(AUTH_DEBUG_PERSISTED_KEY) === 'true'
1919

20-
const navigatorLockEnabled = !!(
20+
const shouldEnableNavigatorLock =
2121
process.env.NEXT_PUBLIC_IS_PLATFORM === 'true' &&
22-
!(globalThis?.localStorage?.getItem(AUTH_NAVIGATOR_LOCK_DISABLED_KEY) === 'true') &&
23-
globalThis?.navigator?.locks
24-
)
22+
!(globalThis?.localStorage?.getItem(AUTH_NAVIGATOR_LOCK_DISABLED_KEY) === 'true')
2523

26-
if (!globalThis?.navigator?.locks) {
24+
const navigatorLockEnabled = !!(shouldEnableNavigatorLock && globalThis?.navigator?.locks)
25+
26+
if (shouldEnableNavigatorLock && !globalThis?.navigator?.locks) {
2727
console.warn('This browser does not support the Navigator Locks API. Please update it.')
2828
}
2929

0 commit comments

Comments
 (0)