diff --git a/native/navigation/deep-links-context-provider.react.js b/native/navigation/deep-links-context-provider.react.js --- a/native/navigation/deep-links-context-provider.react.js +++ b/native/navigation/deep-links-context-provider.react.js @@ -23,14 +23,20 @@ import type { SetState } from 'lib/types/hook-types.js'; import { getMessageForException } from 'lib/utils/errors.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; -import { usingCommServicesAccessToken } from 'lib/utils/services-utils.js'; +import { + usingCommServicesAccessToken, + usingRestoreFlow, +} from 'lib/utils/services-utils.js'; import { InviteLinkModalRouteName, SecondaryDeviceQRCodeScannerRouteName, } from './route-names.js'; import { useSelector } from '../redux/redux-utils.js'; -import { useOnFirstLaunchEffect } from '../utils/hooks.js'; +import { + useShowVersionUnsupportedAlert, + useOnFirstLaunchEffect, +} from '../utils/hooks.js'; type DeepLinksContextType = { +setCurrentLinkUrl: SetState, @@ -95,6 +101,7 @@ const { getAuthMetadata } = identityContext; const invalidTokenLogOut = useInvalidCSATLogOut(); + const showVersionUnsupportedAlert = useShowVersionUnsupportedAlert(false); const loggedIn = useSelector(isLoggedIn); const dispatchActionPromise = useDispatchActionPromise(); const validateLink = useVerifyInviteLink(keyserverOverride); @@ -144,10 +151,21 @@ }); } } else if (parsedData.type === 'qr-code') { + if (!usingRestoreFlow) { + showVersionUnsupportedAlert(); + return; + } navigation.navigate(SecondaryDeviceQRCodeScannerRouteName); } })(); - }, [currentLink, getAuthMetadata, loggedIn, navigation, invalidTokenLogOut]); + }, [ + currentLink, + getAuthMetadata, + loggedIn, + navigation, + invalidTokenLogOut, + showVersionUnsupportedAlert, + ]); React.useEffect(() => { const secret = inviteLinkSecret.current;