Skip to content

Commit 8282fd0

Browse files
committed
web: resolve navigator.locks the way the page does, so the shared-store tests mean the same on every Node
1 parent 6895a7d commit 8282fd0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎web/main.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ async function createSecretStorage() {
309309
// One change at a time within this tab, and — where the browser has Web Locks — across tabs.
310310
let queue = Promise.resolve();
311311
const exclusive = (fn) => {
312-
const run = () => (globalThis.navigator && navigator.locks && navigator.locks.request
312+
const run = () => (typeof navigator !== 'undefined' && navigator.locks && navigator.locks.request
313313
? navigator.locks.request(LOCK, fn)
314314
: fn());
315315
const next = queue.then(run, run);

0 commit comments

Comments
 (0)