Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F2899010
D9028.id30568.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D9028.id30568.diff
View Options
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
@@ -12,6 +12,7 @@
import {
parseSecretFromInviteLinkURL,
parseInstallReferrerFromInviteLinkURL,
+ parseKeysFromQRCodeURL,
} from 'lib/facts/links.js';
import { isLoggedIn } from 'lib/selectors/user-selectors.js';
import type { SetState } from 'lib/types/hook-types.js';
@@ -20,7 +21,10 @@
useServerCall,
} from 'lib/utils/action-utils.js';
-import { InviteLinkModalRouteName } from './route-names.js';
+import {
+ InviteLinkModalRouteName,
+ SecondaryDeviceQRCodeScannerRouteName,
+} from './route-names.js';
import { useSelector } from '../redux/redux-utils.js';
import { useOnFirstLaunchEffect } from '../utils/hooks.js';
@@ -48,7 +52,7 @@
const subscription = Linking.addEventListener('url', ({ url }) =>
setCurrentLink(url),
);
- // We're also checking if the app was opened by using an invite link.
+ // We're also checking if the app was opened by using a link.
// In that case the listener won't be called and we're instead checking
// if the initial URL is set.
(async () => {
@@ -92,24 +96,26 @@
setCurrentLink(null);
const secret = parseSecretFromInviteLinkURL(currentLink);
- if (!secret) {
- return;
- }
-
- const validateLinkPromise = validateLink({ secret });
- dispatchActionPromise(verifyInviteLinkActionTypes, validateLinkPromise);
- const result = await validateLinkPromise;
- if (result.status === 'already_joined') {
- return;
+ const keys = parseKeysFromQRCodeURL(currentLink);
+
+ if (secret) {
+ const validateLinkPromise = validateLink({ secret });
+ dispatchActionPromise(verifyInviteLinkActionTypes, validateLinkPromise);
+ const result = await validateLinkPromise;
+ if (result.status === 'already_joined') {
+ return;
+ }
+
+ navigation.navigate<'InviteLinkModal'>({
+ name: InviteLinkModalRouteName,
+ params: {
+ invitationDetails: result,
+ secret,
+ },
+ });
+ } else if (keys) {
+ navigation.navigate(SecondaryDeviceQRCodeScannerRouteName);
}
-
- navigation.navigate<'InviteLinkModal'>({
- name: InviteLinkModalRouteName,
- params: {
- invitationDetails: result,
- secret,
- },
- });
})();
}, [currentLink, dispatchActionPromise, loggedIn, navigation, validateLink]);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Oct 6, 4:53 AM (21 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2247921
Default Alt Text
D9028.id30568.diff (2 KB)
Attached To
Mode
D9028: [native] Refactor the deep links context provider to support both invite links and QR code links
Attached
Detach File
Event Timeline
Log In to Comment