From 1f8e7c3808164e1d89d49bf5e144b2167f481fdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20S=C3=A1nchez?= Date: Wed, 25 May 2022 20:16:41 +0200 Subject: [PATCH] fix: Update isValidMessage() check for Safe Apps --- src/routes/safe/components/Apps/communicator.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/routes/safe/components/Apps/communicator.ts b/src/routes/safe/components/Apps/communicator.ts index a4b8d238d4..2e0a708ca0 100644 --- a/src/routes/safe/components/Apps/communicator.ts +++ b/src/routes/safe/components/Apps/communicator.ts @@ -43,8 +43,7 @@ class AppCommunicator { return true } - // @ts-expect-error .parent doesn't exist on some possible types - const sentFromIframe = msg.source.parent === window.parent + const sentFromIframe = this.iframeRef.current?.contentWindow === msg.source const knownMethod = Object.values(Methods).includes(msg.data.method) return sentFromIframe && knownMethod