mirror of
https://github.com/selfxyz/self.git
synced 2026-01-10 15:18:18 -05:00
Refactor deep link handling to simplify navigation to ProveScreen (#1104)
* Refactor deep link handling to simplify navigation to ProveScreen - Removed the reset of the navigation stack and replaced it with a direct navigation call to 'Prove'. - This change streamlines the deep link handling process, ensuring a more straightforward user experience when navigating to the ProveScreen. * update lock and fix tests --------- Co-authored-by: Justin Hernandez <justin.hernandez@self.xyz>
This commit is contained in:
committed by
GitHub
parent
6063aedd02
commit
f6881bf2d9
@@ -2479,7 +2479,7 @@ SPEC CHECKSUMS:
|
||||
lottie-ios: a881093fab623c467d3bce374367755c272bdd59
|
||||
lottie-react-native: 7bb65bc88d3f9996ea2f646a96694285405df2f9
|
||||
Mixpanel-swift: e9bef28a9648faff384d5ba6f48ecc2787eb24c0
|
||||
mobile-sdk-alpha: 96949ad8c8b61a9fa6b918a4202f9cebb9c678cc
|
||||
mobile-sdk-alpha: 126edf71b65b5a9e294725e4353c2705fa0fd20d
|
||||
nanopb: 438bc412db1928dac798aa6fd75726007be04262
|
||||
NFCPassportReader: 48873f856f91215dbfa1eaaec20eae639672862e
|
||||
OpenSSL-Universal: 84efb8a29841f2764ac5403e0c4119a28b713346
|
||||
|
||||
@@ -105,10 +105,7 @@ export const handleUrl = (uri: string) => {
|
||||
useSelfAppStore.getState().setSelfApp(selfAppJson);
|
||||
useSelfAppStore.getState().startAppListener(selfAppJson.sessionId);
|
||||
|
||||
// Reset navigation stack with correct parent -> ProveScreen
|
||||
navigationRef.reset(
|
||||
createDeeplinkNavigationState('ProveScreen', correctParentScreen),
|
||||
);
|
||||
navigationRef.navigate('Prove' as never);
|
||||
|
||||
return;
|
||||
} catch (error) {
|
||||
@@ -123,10 +120,7 @@ export const handleUrl = (uri: string) => {
|
||||
useSelfAppStore.getState().cleanSelfApp();
|
||||
useSelfAppStore.getState().startAppListener(sessionId);
|
||||
|
||||
// Reset navigation stack with correct parent -> ProveScreen
|
||||
navigationRef.reset(
|
||||
createDeeplinkNavigationState('ProveScreen', correctParentScreen),
|
||||
);
|
||||
navigationRef.navigate('Prove' as never);
|
||||
} else if (mock_passport) {
|
||||
try {
|
||||
const data = JSON.parse(mock_passport);
|
||||
|
||||
@@ -64,10 +64,7 @@ describe('deeplinks', () => {
|
||||
expect(setSelfApp).toHaveBeenCalledWith(selfApp);
|
||||
expect(startAppListener).toHaveBeenCalledWith('abc');
|
||||
const { navigationRef } = require('@/navigation');
|
||||
expect(navigationRef.reset).toHaveBeenCalledWith({
|
||||
index: 1,
|
||||
routes: [{ name: 'Home' }, { name: 'ProveScreen' }],
|
||||
});
|
||||
expect(navigationRef.navigate).toHaveBeenCalledWith('Prove');
|
||||
});
|
||||
|
||||
it('handles sessionId parameter', () => {
|
||||
@@ -77,10 +74,7 @@ describe('deeplinks', () => {
|
||||
expect(cleanSelfApp).toHaveBeenCalled();
|
||||
expect(startAppListener).toHaveBeenCalledWith('123');
|
||||
const { navigationRef } = require('@/navigation');
|
||||
expect(navigationRef.reset).toHaveBeenCalledWith({
|
||||
index: 1,
|
||||
routes: [{ name: 'Home' }, { name: 'ProveScreen' }],
|
||||
});
|
||||
expect(navigationRef.navigate).toHaveBeenCalledWith('Prove');
|
||||
});
|
||||
|
||||
it('handles mock_passport parameter', () => {
|
||||
|
||||
Reference in New Issue
Block a user