({ Component, pageProps, router }: AppProps)
| 167 | }); |
| 168 | |
| 169 | function InternalApp({ Component, pageProps, router }: AppProps): ReactElement { |
| 170 | const { isOnboardingActionsReady, isOnboardingComplete } = |
| 171 | useOnboardingActions(); |
| 172 | const openedHotAndColdFromQueryRef = useRef(false); |
| 173 | const installReferralRoutedRef = useRef(false); |
| 174 | |
| 175 | const { unreadCount } = useNotificationContext(); |
| 176 | const unreadText = getUnreadText(unreadCount); |
| 177 | const { |
| 178 | user, |
| 179 | trackingId, |
| 180 | isAuthReady, |
| 181 | isFunnel, |
| 182 | shouldShowLogin, |
| 183 | closeLogin, |
| 184 | loginState, |
| 185 | } = useAuthContext(); |
| 186 | // Users arriving from the extension install link land on `/?ref=install`. |
| 187 | // Evaluate the permission primer experiment as soon as auth is ready (so |
| 188 | // GrowthBook attributes are set) — gating on onboarding actions would stall |
| 189 | // logged-out users forever, since the actions query only runs for a user. |
| 190 | const isComingFromInstall = router.query.ref === 'install'; |
| 191 | const { |
| 192 | value: isPermissionPrimerEnabled, |
| 193 | isLoading: isPermissionPrimerLoading, |
| 194 | } = useConditionalFeature({ |
| 195 | feature: featureOnboardingPermissionPrimer, |
| 196 | shouldEvaluate: isComingFromInstall && isAuthReady, |
| 197 | }); |
| 198 | const { showBanner, onAcceptCookies, onOpenBanner, onHideBanner } = |
| 199 | useCookieBanner(); |
| 200 | useWebVitals(); |
| 201 | useLogPageView(); |
| 202 | const { modal, closeModal, openModal } = useLazyModal(); |
| 203 | useConsoleLogo(); |
| 204 | useIOSError(); |
| 205 | |
| 206 | useCheckCoresRole(); |
| 207 | useCheckLocation(); |
| 208 | |
| 209 | const activeModalType = modal?.type; |
| 210 | const hotAndColdModalQuery = router.query[hotAndColdModalQueryKey]; |
| 211 | const shouldOpenHotAndColdFromQuery = |
| 212 | hotAndColdModalQuery === hotAndColdModalQueryValue || |
| 213 | hotAndColdModalQuery === hotAndColdModalLegacyQueryValue || |
| 214 | (Array.isArray(hotAndColdModalQuery) && |
| 215 | (hotAndColdModalQuery.includes(hotAndColdModalQueryValue) || |
| 216 | hotAndColdModalQuery.includes(hotAndColdModalLegacyQueryValue))); |
| 217 | const swipeOnboardingPreviewQuery = |
| 218 | router.query[swipeOnboardingPreviewQueryKey]; |
| 219 | const isSwipeOnboardingPreviewForced = |
| 220 | swipeOnboardingPreviewQuery === '1' || |
| 221 | swipeOnboardingPreviewQuery === 'true' || |
| 222 | (Array.isArray(swipeOnboardingPreviewQuery) && |
| 223 | (swipeOnboardingPreviewQuery.includes('1') || |
| 224 | swipeOnboardingPreviewQuery.includes('true'))); |
| 225 | |
| 226 | useEffect(() => { |
nothing calls this directly
no test coverage detected