diff --git a/packages/huma-shared/src/utils/env.ts b/packages/huma-shared/src/utils/env.ts index 1bcfb94..c779c78 100644 --- a/packages/huma-shared/src/utils/env.ts +++ b/packages/huma-shared/src/utils/env.ts @@ -4,5 +4,6 @@ export const checkIsDev = () => window.location.hostname.startsWith('v2') || window.location.hostname.startsWith('pr-') || window.location.hostname.startsWith('deploy-preview') || + window.location.hostname.startsWith('localhost') || process.env.NODE_ENV === 'development' ) diff --git a/packages/huma-widget/src/components/Lend/supplyV2/7-Notifications.tsx b/packages/huma-widget/src/components/Lend/supplyV2/7-Notifications.tsx index bf5ffd1..85be158 100644 --- a/packages/huma-widget/src/components/Lend/supplyV2/7-Notifications.tsx +++ b/packages/huma-widget/src/components/Lend/supplyV2/7-Notifications.tsx @@ -25,5 +25,10 @@ export function Notifications({ } }, [campaign, dispatch, handleAction]) - return + return ( + + ) } diff --git a/packages/huma-widget/src/components/Notifi/NotifiSubscriptionModal.tsx b/packages/huma-widget/src/components/Notifi/NotifiSubscriptionModal.tsx index b8433f9..2f5c967 100644 --- a/packages/huma-widget/src/components/Notifi/NotifiSubscriptionModal.tsx +++ b/packages/huma-widget/src/components/Notifi/NotifiSubscriptionModal.tsx @@ -20,6 +20,7 @@ import { LoadingModal } from '../LoadingModal' import { WrapperModal } from '../WrapperModal' type Props = { + successText?: string handleSuccess: () => void } @@ -34,6 +35,7 @@ const validateDefaultTargetGroup = async ( } export function NotifiSubscriptionModal({ + successText, handleSuccess, }: Props): React.ReactElement { const theme = useTheme() @@ -93,6 +95,16 @@ export function NotifiSubscriptionModal({ await subscribeAlertsDefault(fusionEventTopics, targetGroupId) await updateFtuStage(FtuStage.Done) + + const targetGroup = ( + await frontendClient?.fetchFusionData() + )?.targetGroup?.find((group) => group?.name === 'Default') + const emailTarget = targetGroup?.emailTargets?.[0] + if (emailTarget && !emailTarget.isConfirmed) { + await frontendClient.sendEmailTargetVerification({ + targetId: emailTarget.id, + }) + } } setShowSuccessScreen(true) @@ -111,6 +123,7 @@ export function NotifiSubscriptionModal({ updateFtuStage, isLoadingFtuStage, ftuStage, + frontendClient, ]) useEffect(() => { @@ -190,7 +203,7 @@ export function NotifiSubscriptionModal({ - DONE + {successText ?? 'DONE'} ) diff --git a/packages/huma-widget/src/hooks/useNotifi.ts b/packages/huma-widget/src/hooks/useNotifi.ts index 047bd82..7aacdce 100644 --- a/packages/huma-widget/src/hooks/useNotifi.ts +++ b/packages/huma-widget/src/hooks/useNotifi.ts @@ -77,7 +77,7 @@ export const useIsFirstTimeNotifiUser = ( useEffect(() => { const checkIsFirstTimeNotifiUser = async () => { - if (isInitialized && notifiChainSupported && !isLoadingFtu) { + if (isInitialized && notifiChainSupported) { // If the user is not authenticated or expired, they are possibly a first time user. if (!isAuthenticated || isExpired) { setIsFirstTimeNotifiUser(true)