diff --git a/src/contexts/BALWidget.context.tsx b/src/contexts/BALWidget.context.tsx index 5522d3954..93a3b07d5 100644 --- a/src/contexts/BALWidget.context.tsx +++ b/src/contexts/BALWidget.context.tsx @@ -3,7 +3,6 @@ import { useCallback, useEffect, useRef, useState, createContext } from 'react' import styled, { css } from 'styled-components' import { matomoTrackEvent } from '@/lib/matomo' import { env } from 'next-runtime-env' -import { useRouter } from 'next/navigation' export const StyledIFrame = styled.iframe<{ $isOpen: boolean, $isVisible: boolean }>` position: fixed; @@ -53,7 +52,6 @@ interface BALWidgetProviderProps { export function BALWidgetProvider({ children }: BALWidgetProviderProps) { const balWidgetRef = useRef(null) - const router = useRouter() const transitionTimeout = useRef() const [isWidgetDisplayed, setIsWidgetDisplayed] = useState(false) const [isWidgetVisible, setIsWidgetVisible] = useState(true) @@ -161,7 +159,7 @@ export function BALWidgetProvider({ children }: BALWidgetProviderProps) { setIsBalWidgetConfigLoaded(true) break case 'BAL_WIDGET_PARENT_NAVIGATE_TO': - router.push(event.data.content) + window.location.href = event.data.content break default: break @@ -175,7 +173,7 @@ export function BALWidgetProvider({ children }: BALWidgetProviderProps) { window.removeEventListener('message', BALWidgetMessageHandler) clearTimeout(transitionTimeout.current) } - }, [isBalWidgetOpen, router]) + }, [isBalWidgetOpen]) return (