@chromahq/react 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -149,7 +149,7 @@ const BridgeProvider = ({
|
|
|
149
149
|
}
|
|
150
150
|
});
|
|
151
151
|
const bridgeInstance = {
|
|
152
|
-
send: (key, payload) => {
|
|
152
|
+
send: (key, payload, timeoutDuration = 1e4) => {
|
|
153
153
|
return new Promise((resolve, reject) => {
|
|
154
154
|
if (!portRef.current) {
|
|
155
155
|
reject(new Error("Bridge disconnected"));
|
|
@@ -162,7 +162,7 @@ const BridgeProvider = ({
|
|
|
162
162
|
pendingRef.current.delete(id);
|
|
163
163
|
reject(new Error("Request timeout"));
|
|
164
164
|
}
|
|
165
|
-
},
|
|
165
|
+
}, timeoutDuration);
|
|
166
166
|
try {
|
|
167
167
|
portRef.current.postMessage({ id, key, payload });
|
|
168
168
|
setTimeout(() => {
|