From 256198f83f83b2165d36866cfa8a79b4be99c80c Mon Sep 17 00:00:00 2001 From: Neil MacDougall Date: Thu, 24 Jun 2021 12:08:50 +0100 Subject: [PATCH] Fix rediretc issue when embedding istio configuration --- .../addon/components/modal-delete-istio/component.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/istio/addon/components/modal-delete-istio/component.js b/lib/istio/addon/components/modal-delete-istio/component.js index 73488d154..6eddcef73 100644 --- a/lib/istio/addon/components/modal-delete-istio/component.js +++ b/lib/istio/addon/components/modal-delete-istio/component.js @@ -46,9 +46,15 @@ export default Component.extend(ModalBase, { } PromiseAll(promises).then(() => { - setTimeout(() => { - window.location.href = window.location.href; // eslint-disable-line no-self-assign - }, 1000); + const isEmbedded = window.top !== window; + + if (isEmbedded) { + window.top.postMessage({ action: 'reload' }); + } else { + setTimeout(() => { + window.location.href = window.location.href; // eslint-disable-line no-self-assign + }, 1000); + } }).catch((err) => { get(this, 'growl').fromError(get(err, 'body.message')); }).finally(() => {