From dd46c1b1b9c841257dc27fda3bc5ef56d27d0f00 Mon Sep 17 00:00:00 2001 From: Hui Zhao Date: Mon, 4 Mar 2024 14:41:26 -0800 Subject: [PATCH] chore(rtn-web-browser): run yarn lint:fix --- packages/rtn-web-browser/src/apis/openAuthSessionAsync.ts | 5 ++++- packages/rtn-web-browser/src/nativeModule.ts | 1 + packages/rtn-web-browser/src/types/native.ts | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/rtn-web-browser/src/apis/openAuthSessionAsync.ts b/packages/rtn-web-browser/src/apis/openAuthSessionAsync.ts index 55344564fc3..e6091abdeac 100644 --- a/packages/rtn-web-browser/src/apis/openAuthSessionAsync.ts +++ b/packages/rtn-web-browser/src/apis/openAuthSessionAsync.ts @@ -7,6 +7,7 @@ import { NativeEventSubscription, Platform, } from 'react-native'; + import { nativeModule } from '../nativeModule'; let appStateListener: NativeEventSubscription | undefined; @@ -31,12 +32,13 @@ export const openAuthSessionAsync = async ( const openAuthSessionIOS = async ( url: string, redirectUrls: string[], - prefersEphemeralSession: boolean = false, + prefersEphemeralSession = false, ) => { const redirectUrl = redirectUrls.find( // take the first non-web url as the deeplink item => !item.startsWith('https://') && !item.startsWith('http://'), ); + return nativeModule.openAuthSessionAsync( url, redirectUrl, @@ -56,6 +58,7 @@ const openAuthSessionAndroid = async (url: string, redirectUrls: string[]) => { // open chrome tab nativeModule.openAuthSessionAsync(url), ]); + return redirectUrl; } finally { appStateListener?.remove(); diff --git a/packages/rtn-web-browser/src/nativeModule.ts b/packages/rtn-web-browser/src/nativeModule.ts index bc534235bde..4cf728a19bf 100644 --- a/packages/rtn-web-browser/src/nativeModule.ts +++ b/packages/rtn-web-browser/src/nativeModule.ts @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import { NativeModules } from 'react-native'; + import { LINKING_ERROR } from './constants'; import { WebBrowserNativeModule } from './types'; diff --git a/packages/rtn-web-browser/src/types/native.ts b/packages/rtn-web-browser/src/types/native.ts index b3172af60e0..00717351561 100644 --- a/packages/rtn-web-browser/src/types/native.ts +++ b/packages/rtn-web-browser/src/types/native.ts @@ -4,9 +4,9 @@ import { NativeModule } from 'react-native'; export interface WebBrowserNativeModule extends NativeModule { - openAuthSessionAsync: ( + openAuthSessionAsync( url: string, redirectUrl?: string, prefersEphemeralSession?: boolean, - ) => Promise; + ): Promise; }