fix
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
||||
dispatchEmbedScanResult,
|
||||
acknowledgeEmbedScanConsumed,
|
||||
dispatchEmbedScanError,
|
||||
setEmbedScanHostEnabled,
|
||||
} from "./services/provider/scan";
|
||||
import {
|
||||
setEmbedScanResultForwarder,
|
||||
@@ -139,7 +140,7 @@ function broadcastScanErrorToEmbedChildren(error) {
|
||||
});
|
||||
}
|
||||
|
||||
function broadcastScanResultToEmbedChildren(result) {
|
||||
function broadcastScanResultToEmbedChildren(result, meta) {
|
||||
if (embedChildSources.size === 0 || result == null || result === "") {
|
||||
return;
|
||||
}
|
||||
@@ -151,6 +152,7 @@ function broadcastScanResultToEmbedChildren(result) {
|
||||
v: EMBED_V,
|
||||
kind: "forwardScanResult",
|
||||
result,
|
||||
scanSource: meta && meta.source,
|
||||
},
|
||||
"*"
|
||||
);
|
||||
@@ -217,7 +219,9 @@ function embedChildOnMessage(ev) {
|
||||
}
|
||||
if (data.kind === "forwardScanResult") {
|
||||
if (typeof data.result === "string") {
|
||||
const consumed = dispatchEmbedScanResult(data.result);
|
||||
const consumed = dispatchEmbedScanResult(data.result, {
|
||||
source: data.scanSource,
|
||||
});
|
||||
if (consumed && resolveUseParentProxy()) {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
@@ -349,6 +353,7 @@ export function installEmbedHost(lib) {
|
||||
embedHostInstalled = true;
|
||||
setEmbedScanResultForwarder(broadcastScanResultToEmbedChildren);
|
||||
setEmbedScanErrorForwarder(broadcastScanErrorToEmbedChildren);
|
||||
setEmbedScanHostEnabled(true);
|
||||
window.addEventListener("message", (ev) => {
|
||||
const data = ev.data;
|
||||
if (!isEmbedMessage(data)) {
|
||||
|
||||
Reference in New Issue
Block a user