From a90983e7ef573b2cbfe75cd17afae30a7011ba4c Mon Sep 17 00:00:00 2001 From: Philipp Pracht Date: Fri, 25 Feb 2022 15:17:00 +0100 Subject: [PATCH] confirmation modal from special iframe mfes (#2594) --- core/src/App.svelte | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/src/App.svelte b/core/src/App.svelte index 0586932835..450023993c 100644 --- a/core/src/App.svelte +++ b/core/src/App.svelte @@ -832,19 +832,20 @@ resetConfirmationModalData(); - export const showModal = (settings, openFromClient = false) => { + export const showModal = (settings, openFromClient = false, targetIframe) => { return new Promise((resolve, reject) => { confirmationModal = { displayed: true, settings, openFromClient, promise: { resolve, reject }, + targetIframe, }; }); }; const handleModalResult = (result) => { - const { promise, openFromClient } = confirmationModal; + const { promise, openFromClient, targetIframe } = confirmationModal; resetConfirmationModalData(); @@ -854,13 +855,12 @@ promise.reject(); } - if (openFromClient) { - const iframe = Iframe.getActiveIframe(contentNode); + if (openFromClient && targetIframe) { const message = { msg: 'luigi.ux.confirmationModal.hide', data: { confirmed: result }, }; - IframeHelpers.sendMessageToIframe(iframe, message); + IframeHelpers.sendMessageToIframe(targetIframe, message); } }; @@ -1433,7 +1433,7 @@ const settings = e.data.data.settings; contentNode = node; resetConfirmationModalData(); - showModal(settings, true).catch(() => { + showModal(settings, true, iframe).catch(() => { /* keep it to avoid runtime errors in browser console */ }); }