diff --git a/src/app/features/hiro-messages/in-app-messages.tsx b/src/app/features/hiro-messages/in-app-messages.tsx index 3a74216854e..e3c41207dda 100644 --- a/src/app/features/hiro-messages/in-app-messages.tsx +++ b/src/app/features/hiro-messages/in-app-messages.tsx @@ -1,5 +1,9 @@ +import { useLocation } from 'react-router-dom'; + import { Flex, FlexProps } from 'leather-styles/jsx'; +import { RouteUrls } from '@shared/route-urls'; + import { useRemoteLeatherMessages } from '@app/query/common/remote-config/remote-config.query'; import { useCurrentNetworkState } from '@app/store/networks/networks.hooks'; import { useDismissMessage } from '@app/store/settings/settings.actions'; @@ -7,15 +11,15 @@ import { useDismissedMessageIds } from '@app/store/settings/settings.selectors'; import { HiroMessageItem } from './components/in-app-message-item'; -// See wallet-config.md for instructions on testing InAppMessages export function InAppMessages(props: FlexProps) { + const location = useLocation(); const messages = useRemoteLeatherMessages(); const { mode } = useCurrentNetworkState(); const dismissMessage = useDismissMessage(); const dismissedIds = useDismissedMessageIds(); - if (messages.length === 0) return null; + if (location.pathname !== RouteUrls.Home || messages.length === 0) return null; const firstMessage = messages.filter(msg => !dismissedIds.includes(msg.id))[0];