diff --git a/src/apps/components/AppFrame/AppFrame.tsx b/src/apps/components/AppFrame/AppFrame.tsx index 51f030a65..6d3f9bcbd 100644 --- a/src/apps/components/AppFrame/AppFrame.tsx +++ b/src/apps/components/AppFrame/AppFrame.tsx @@ -33,12 +33,21 @@ export const AppFrame: React.FC = ({ }) => { const shop = useShop(); const frameRef = React.useRef(); - const { sendThemeToExtension } = useTheme(); + const { themeType } = useTheme(); const classes = useStyles(); const appOrigin = getOrigin(src); const { postToExtension } = useAppActions(frameRef, appOrigin, appId); const location = useLocation(); + useEffect(() => { + postToExtension({ + type: "theme", + payload: { + theme: themeType, + }, + }); + }, [themeType, postToExtension]); + useEffect(() => { postToExtension({ type: "redirect", @@ -58,7 +67,12 @@ export const AppFrame: React.FC = ({ version: 1, }, }); - sendThemeToExtension(); + postToExtension({ + type: "theme", + payload: { + theme: themeType, + }, + }); if (onLoad) { onLoad();