Skip to content

Commit 54bd242

Browse files
authored
Merge pull request #53863 from callstack-internal/VickyStash/bugfix/53510-fix-bank-flashes
Fix screen briefly flashes Chase feed page after connecting Amex feed and back to expensify
2 parents b49e1bd + 3e04c0a commit 54bd242

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

src/pages/workspace/companyCards/addNew/BankConnection/index.native.tsx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import React, {useEffect, useMemo, useRef, useState} from 'react';
1+
import React, {useEffect, useMemo, useRef} from 'react';
22
import {useOnyx} from 'react-native-onyx';
33
import {WebView} from 'react-native-webview';
44
import type {ValueOf} from 'type-fest';
55
import FullPageOfflineBlockingView from '@components/BlockingViews/FullPageOfflineBlockingView';
66
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
77
import HeaderWithBackButton from '@components/HeaderWithBackButton';
8-
import Modal from '@components/Modal';
8+
import ScreenWrapper from '@components/ScreenWrapper';
99
import useLocalize from '@hooks/useLocalize';
1010
import usePrevious from '@hooks/usePrevious';
1111
import * as CardUtils from '@libs/CardUtils';
@@ -26,7 +26,6 @@ type BankConnectionStepProps = {
2626
function BankConnection({policyID}: BankConnectionStepProps) {
2727
const {translate} = useLocalize();
2828
const webViewRef = useRef<WebView>(null);
29-
const [isWebViewOpen, setWebViewOpen] = useState(false);
3029
const [session] = useOnyx(ONYXKEYS.SESSION);
3130
const authToken = session?.authToken ?? null;
3231
const [addNewCard] = useOnyx(ONYXKEYS.ADD_NEW_COMPANY_CARD);
@@ -40,7 +39,6 @@ function BankConnection({policyID}: BankConnectionStepProps) {
4039
const renderLoading = () => <FullScreenLoadingIndicator />;
4140

4241
const handleBackButtonPress = () => {
43-
setWebViewOpen(false);
4442
if (bankName === CONST.COMPANY_CARDS.BANKS.BREX) {
4543
CompanyCards.setAddNewCompanyCardStepAndData({step: CONST.COMPANY_CARDS.STEP.SELECT_BANK});
4644
return;
@@ -52,10 +50,6 @@ function BankConnection({policyID}: BankConnectionStepProps) {
5250
CompanyCards.setAddNewCompanyCardStepAndData({step: CONST.COMPANY_CARDS.STEP.SELECT_FEED_TYPE});
5351
};
5452

55-
useEffect(() => {
56-
setWebViewOpen(true);
57-
}, []);
58-
5953
useEffect(() => {
6054
if (!url) {
6155
return;
@@ -69,11 +63,12 @@ function BankConnection({policyID}: BankConnectionStepProps) {
6963
}, [isNewFeedConnected, newFeed, policyID, url]);
7064

7165
return (
72-
<Modal
73-
onClose={handleBackButtonPress}
74-
fullscreen
75-
isVisible={isWebViewOpen}
76-
type={CONST.MODAL.MODAL_TYPE.CENTERED_UNSWIPEABLE}
66+
<ScreenWrapper
67+
testID={BankConnection.displayName}
68+
shouldShowOfflineIndicator={false}
69+
includeSafeAreaPaddingBottom={false}
70+
shouldEnablePickerAvoiding={false}
71+
shouldEnableMaxHeight
7772
>
7873
<HeaderWithBackButton
7974
title={translate('workspace.companyCards.addCards')}
@@ -96,7 +91,7 @@ function BankConnection({policyID}: BankConnectionStepProps) {
9691
/>
9792
)}
9893
</FullPageOfflineBlockingView>
99-
</Modal>
94+
</ScreenWrapper>
10095
);
10196
}
10297

0 commit comments

Comments
 (0)