@lvce-editor/ipc 7.4.0 → 8.0.0
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/browser.js +11 -1
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -370,7 +370,17 @@ class IpcChildWithWindow extends Ipc {
|
|
|
370
370
|
// ignore
|
|
371
371
|
}
|
|
372
372
|
onMessage(callback) {
|
|
373
|
-
|
|
373
|
+
const wrapped = event => {
|
|
374
|
+
const {
|
|
375
|
+
ports
|
|
376
|
+
} = event;
|
|
377
|
+
if (ports.length) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
callback(event);
|
|
381
|
+
this._rawIpc.removeEventListener('message', wrapped);
|
|
382
|
+
};
|
|
383
|
+
this._rawIpc.addEventListener('message', wrapped);
|
|
374
384
|
}
|
|
375
385
|
}
|
|
376
386
|
const wrap$2 = window => {
|