Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}).then(win => {
if (!bridge || !bridge.needsBridge({ win, domain }) || bridge.hasBridge(domain, domain)) {
return;
}
const bridgeUrl = this.component.getBridgeUrl();
if (!bridgeUrl) {
throw new Error(`Bridge needed to render ${ context }`);
}
const bridgeDomain = getDomainFromUrl(bridgeUrl);
bridge.linkUrl(win, domain);
return bridge.openBridge(normalizeMockUrl(bridgeUrl), bridgeDomain);
});
}
}).then(win => {
if (!bridge || !bridge.needsBridge({ win, domain }) || bridge.hasBridge(domain, domain)) {
return;
}
let bridgeUrl = this.component.getBridgeUrl(this.props);
if (!bridgeUrl) {
throw new Error(`Bridge url and domain needed to render ${ context }`);
}
let bridgeDomain = getDomainFromUrl(bridgeUrl);
bridge.linkUrl(win, domain);
return bridge.openBridge(bridgeUrl, bridgeDomain);
});
}
}).then(function (win) {
if (!bridge || !bridge.needsBridge({ win: win, domain: domain }) || bridge.hasBridge(domain, domain)) {
return;
}
var bridgeUrl = _this7.component.getBridgeUrl(_this7.props);
if (!bridgeUrl) {
throw new Error('Bridge url and domain needed to render ' + context);
}
var bridgeDomain = getDomainFromUrl(bridgeUrl);
bridge.linkUrl(win, domain);
return bridge.openBridge(bridgeUrl, bridgeDomain);
});
};
return ZalgoPromise.try(() => {
let metaFrameDomain : string = config.paypalDomains[env];
if (!bridge || !bridge.needsBridge({ domain: metaFrameDomain })) {
return debug(`post_bridge_not_required`, { env });
}
debug(`setup_post_bridge`, { env });
return openMetaFrame(env).then(noop);
});
}