Skip to content

Commit fd90b26

Browse files
committed
Track client support for web locks API
1 parent 2cbb3f9 commit fd90b26

File tree

1 file changed

+5
-0
lines changed
  • contentcuration/contentcuration/frontend/shared/data

1 file changed

+5
-0
lines changed

contentcuration/contentcuration/frontend/shared/data/locks.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import logging from 'shared/logging';
2+
13
/**
24
* Acquire an exclusive lock on the given name using the browser's Web Locks API,
35
* and then run the given async function.
@@ -18,6 +20,9 @@ export function acquireLock({ name, exclusive = false }, asyncFunction) {
1820
},
1921
asyncFunction
2022
);
23+
} else {
24+
// Track if clients aren't supporting the Web Locks API
25+
logging.error(new Error('Web Locks API not supported by browser'));
2126
}
2227
// Studio's supported browsers should support Web Locks but don't outright fail otherwise
2328
return asyncFunction();

0 commit comments

Comments
 (0)