Skip to content

Commit aaaec55

Browse files
authored
fix(widget): revert "fix(widget): consider widget when inside an iframe (#6447)" (#6452)
This reverts commit 9817a4e.
1 parent c2ff10d commit aaaec55

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

apps/cowswap-frontend/src/common/hooks/useCustomTheme.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ export function resolveCowSwapTheme(darkMode: boolean, featureFlags?: FeatureFla
2626
export function useCustomTheme(): CowSwapTheme | undefined {
2727
const [darkMode] = useDarkModeManager()
2828
const featureFlags = useAtomValue(featureFlagsAtom)
29+
const isWidget = isInjectedWidget()
2930

3031
// We don't want to set any custom theme for the widget
31-
if (isInjectedWidget()) {
32+
if (isWidget) {
3233
return undefined
3334
}
3435

libs/common-utils/src/isInjectedWidget.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
import { isIframe } from './isIframe'
2-
31
/**
42
* Detects if the current page is running in widget mode
53
* by checking for '/widget' in the URL hash
64
*/
75
export function isInjectedWidget(): boolean {
86
if (typeof window === 'undefined') return false
97

10-
if (isIframe()) return true
11-
128
try {
139
const hash = new URL(window.location.href).hash
1410
return hash.split('/').includes('widget')

0 commit comments

Comments
 (0)