Page MenuHomePhabricator

D11114.diff
No OneTemporary

D11114.diff

diff --git a/web/web-lock.js b/web/web-lock.js
--- a/web/web-lock.js
+++ b/web/web-lock.js
@@ -94,6 +94,17 @@
return lockStatuses.ACQUIRED;
}, [lockRequest, isVisible]);
+ React.useEffect(() => {
+ if (!import.meta.webpackHot) {
+ return undefined;
+ }
+ const webpackHot: WebpackHot = (import.meta.webpackHot: any);
+ webpackHot.dispose(releaseLockOrAbortRequest);
+ return () => {
+ webpackHot.removeDisposeHandler(releaseLockOrAbortRequest);
+ };
+ }, [releaseLockOrAbortRequest]);
+
return { lockStatus, releaseLockOrAbortRequest };
}
@@ -127,4 +138,9 @@
type LockMode = 'exclusive' | 'shared';
+type WebpackHot = {
+ +dispose: ((data: mixed) => void) => void,
+ +removeDisposeHandler: ((data: mixed) => void) => void,
+};
+
export { useWebLock };

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 25, 6:56 AM (21 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2578873
Default Alt Text
D11114.diff (807 B)

Event Timeline