fix(client): handle challenge resets with hidden preview (#44570)

This commit is contained in:
Oliver Eyton-Williams
2021-12-23 14:34:26 +00:00
committed by GitHub
parent dfd3fd452d
commit 85b9daedb8

View File

@ -91,7 +91,8 @@ const mountFrame =
};
const buildProxyConsole = proxyLogger => ctx => {
if (proxyLogger) {
// window does not exist if the preview is hidden, so we have to check.
if (proxyLogger && ctx?.window) {
const oldLog = ctx.window.console.log.bind(ctx.window.console);
ctx.window.console.log = function proxyConsole(...args) {
proxyLogger(args.map(arg => format(arg)).join(' '));