优化
This commit is contained in:
@@ -120,7 +120,7 @@ function hydrateEmbedParams(params, messageSource, targetOrigin) {
|
||||
return params.map(walk);
|
||||
}
|
||||
|
||||
function broadcastScanErrorToEmbedChildren(error) {
|
||||
function broadcastScanErrorToEmbedChildren(error, meta) {
|
||||
if (embedChildSources.size === 0 || error == null || error === "") {
|
||||
return;
|
||||
}
|
||||
@@ -132,6 +132,7 @@ function broadcastScanErrorToEmbedChildren(error) {
|
||||
v: EMBED_V,
|
||||
kind: "forwardScanError",
|
||||
error,
|
||||
scanKey: meta && meta.scanKey,
|
||||
},
|
||||
"*"
|
||||
);
|
||||
@@ -153,6 +154,7 @@ function broadcastScanResultToEmbedChildren(result, meta) {
|
||||
kind: "forwardScanResult",
|
||||
result,
|
||||
scanSource: meta && meta.source,
|
||||
scanKey: meta && meta.scanKey,
|
||||
},
|
||||
"*"
|
||||
);
|
||||
@@ -221,6 +223,7 @@ function embedChildOnMessage(ev) {
|
||||
if (typeof data.result === "string") {
|
||||
const consumed = dispatchEmbedScanResult(data.result, {
|
||||
source: data.scanSource,
|
||||
scanKey: data.scanKey,
|
||||
});
|
||||
if (consumed && resolveUseParentProxy()) {
|
||||
window.parent.postMessage(
|
||||
@@ -238,7 +241,9 @@ function embedChildOnMessage(ev) {
|
||||
}
|
||||
if (data.kind === "forwardScanError") {
|
||||
if (typeof data.error === "string") {
|
||||
dispatchEmbedScanError(data.error);
|
||||
dispatchEmbedScanError(data.error, {
|
||||
scanKey: data.scanKey,
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user