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:
turnoffthiscomputer
2025-09-20 07:41:55 +02:00
committed by GitHub
parent 6063aedd02
commit f6881bf2d9
3 changed files with 5 additions and 17 deletions

View File

@@ -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

View File

@@ -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);

View File

@@ -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', () => {