Skip to content

Commit c9296d7

Browse files
committed
fix: units
1 parent faa393a commit c9296d7

3 files changed

Lines changed: 23 additions & 9 deletions

File tree

src/libs/Navigation/linkingConfig/subscribe.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
import type {LinkingOptions} from '@react-navigation/native';
22
import {findFocusedRoute} from '@react-navigation/native';
3-
import {Linking, Platform, TurboModuleRegistry} from 'react-native';
4-
import type {TurboModule} from 'react-native';
3+
import {Linking} from 'react-native';
4+
import continuePlaidOAuth from '@libs/continuePlaidOAuth';
55
import navigationRef from '@libs/Navigation/navigationRef';
66
import type {RootNavigatorParamList} from '@libs/Navigation/types';
77
import CONST from '@src/CONST';
88
import ROUTES from '@src/ROUTES';
99

10-
type PlaidNativeBridge = TurboModule & {
11-
continueFromRedirectUri: (urlString: string) => void;
12-
};
13-
14-
const plaidNativeBridge = Platform.OS === 'ios' ? TurboModuleRegistry.get<PlaidNativeBridge>('RNLinksdk') : null;
15-
1610
const subscribe: LinkingOptions<RootNavigatorParamList>['subscribe'] = (listener) => {
1711
const subscription = Linking.addEventListener('url', ({url}: {url: string}) => {
1812
// Skip GPS distance screen deep links when the user is already on that screen.
@@ -34,7 +28,7 @@ const subscribe: LinkingOptions<RootNavigatorParamList>['subscribe'] = (listener
3428
// Forward the OAuth redirect URI into the Plaid SDK so it can finalize OAuth.
3529
// Without this, the native SDK never sees the callback URL and retries OAuth in a loop
3630
// after app-to-app bank auth returns. See issue #87757.
37-
plaidNativeBridge?.continueFromRedirectUri(url);
31+
continuePlaidOAuth(url);
3832
return;
3933
}
4034
listener(url);
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import {TurboModuleRegistry} from 'react-native';
2+
import type {TurboModule} from 'react-native';
3+
4+
type PlaidBridge = TurboModule & {
5+
continueFromRedirectUri: (urlString: string) => void;
6+
};
7+
8+
const bridge = TurboModuleRegistry.get<PlaidBridge>('RNLinksdk');
9+
10+
function continuePlaidOAuth(url: string): void {
11+
bridge?.continueFromRedirectUri(url);
12+
}
13+
14+
export default continuePlaidOAuth;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2+
function continuePlaidOAuth(_url: string): void {
3+
// Plaid OAuth return is handled only on iOS HybridApp (see issue #87757).
4+
}
5+
6+
export default continuePlaidOAuth;

0 commit comments

Comments
 (0)