Skip to content

Commit b85e117

Browse files
committed
feat(onboarding): mobile app link resolving
1 parent cb3d0f6 commit b85e117

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

packages/webapp/components/onboarding/OnboardingV2.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -213,19 +213,18 @@ export const OnboardingV2 = (): ReactElement => {
213213
const { onEnablePush } = usePushNotificationMutation();
214214
const isLaptop = useViewSize(ViewSize.Laptop);
215215
const isNativeApp = isIOSNative() || !!isAndroidApp;
216-
const isIOSDevice = isIOS();
217-
const isAndroidDevice =
218-
typeof navigator !== 'undefined' && /android/i.test(navigator.userAgent);
219-
const getMobileStoreUrl = () => {
220-
if (isIOSDevice) {
216+
const mobileStoreUrl = useMemo(() => {
217+
if (isIOS()) {
221218
return appStoreUrl;
222219
}
223-
if (isAndroidDevice) {
220+
if (
221+
typeof navigator !== 'undefined' &&
222+
/android/i.test(navigator.userAgent)
223+
) {
224224
return playStoreUrl;
225225
}
226226
return null;
227-
};
228-
const mobileStoreUrl = getMobileStoreUrl();
227+
}, []);
229228
const showExtensionCta = isLaptop && !isNativeApp;
230229
const showMobileAppCta = !isNativeApp;
231230
const [showMobileAppPopup, setShowMobileAppPopup] = useState(false);

0 commit comments

Comments
 (0)