From 67adfbfe87d74213739ae0aa16ff3522ea85753b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=B3vis=20Neto?= Date: Wed, 9 Oct 2024 12:12:23 +0200 Subject: [PATCH] style(tx-builder-theme-provider): use destructor assignment in the function arguments --- apps/tx-builder/src/theme/SafeThemeProvider.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/tx-builder/src/theme/SafeThemeProvider.tsx b/apps/tx-builder/src/theme/SafeThemeProvider.tsx index 8b02b667..41c63fd3 100644 --- a/apps/tx-builder/src/theme/SafeThemeProvider.tsx +++ b/apps/tx-builder/src/theme/SafeThemeProvider.tsx @@ -23,10 +23,10 @@ const SafeThemeProvider: FC = ({ children }) => { '*', ) - window.addEventListener('message', function (event) { - if (!event.data?.data.hasOwnProperty('darkMode')) return + window.addEventListener('message', function ({ data: eventData }) { + if (!eventData?.data.hasOwnProperty('darkMode')) return - setDarkMode(event.data?.data.darkMode) + setDarkMode(eventData?.data.darkMode) }) }, [])