Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/pages/EnablePayments/EnablePayments.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useEffect} from 'react';
import {View} from 'react-native';
import DelegateNoAccessWrapper from '@components/DelegateNoAccessWrapper';
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import ScreenWrapper from '@components/ScreenWrapper';
Expand All @@ -26,7 +25,6 @@ function EnablePaymentsPage() {
const {isOffline} = useNetwork();
const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {canBeMissing: true});
const [bankAccountList] = useOnyx(ONYXKEYS.BANK_ACCOUNT_LIST, {canBeMissing: true});
const [isActingAsDelegate] = useOnyx(ONYXKEYS.ACCOUNT, {selector: (account) => !!account?.delegatedAccess?.delegate, canBeMissing: true});

useEffect(() => {
if (isOffline) {
Expand All @@ -38,18 +36,6 @@ function EnablePaymentsPage() {
}
}, [isOffline, userWallet]);

if (isActingAsDelegate) {
return (
<ScreenWrapper
testID={EnablePaymentsPage.displayName}
includeSafeAreaPaddingBottom={false}
shouldEnablePickerAvoiding={false}
>
<DelegateNoAccessWrapper accessDeniedVariants={[CONST.DELEGATE.DENIED_ACCESS_VARIANTS.DELEGATE]} />
</ScreenWrapper>
);
}

if (isEmptyObject(userWallet)) {
return <FullScreenLoadingIndicator />;
}
Expand Down
28 changes: 0 additions & 28 deletions src/pages/settings/Wallet/WalletPage/WalletPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import React, {useCallback, useContext, useEffect, useLayoutEffect, useRef, useS
import type {GestureResponderEvent} from 'react-native';
import {ActivityIndicator, View} from 'react-native';
import ConfirmModal from '@components/ConfirmModal';
import {DelegateNoAccessContext} from '@components/DelegateNoAccessModalProvider';
import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator';
import HeaderWithBackButton from '@components/HeaderWithBackButton';
import Icon from '@components/Icon';
Expand Down Expand Up @@ -71,7 +70,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
const [userAccount] = useOnyx(ONYXKEYS.ACCOUNT, {canBeMissing: true});
const [lastUsedPaymentMethods] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD, {canBeMissing: true});
const isUserValidated = userAccount?.validated ?? false;
const {isActingAsDelegate, showDelegateNoAccessModal} = useContext(DelegateNoAccessContext);
const {isAccountLocked, showLockedAccountModal} = useContext(LockedAccountContext);
const {isBetaEnabled} = usePermissions();

Expand Down Expand Up @@ -212,10 +210,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
setShouldShowDefaultDeleteMenu(false);
return;
}
if (isActingAsDelegate) {
showDelegateNoAccessModal();
return;
}
if (isAccountLocked) {
showLockedAccountModal();
return;
Expand Down Expand Up @@ -545,10 +539,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
icon={Expensicons.Wallet}
ref={buttonRef as ForwardedRef<View>}
onPress={() => {
if (isActingAsDelegate) {
showDelegateNoAccessModal();
return;
}
if (isAccountLocked) {
showLockedAccountModal();
return;
Expand Down Expand Up @@ -616,12 +606,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
title={translate('walletPage.setDefaultConfirmation')}
icon={Expensicons.Star}
onPress={() => {
if (isActingAsDelegate) {
closeModal(() => {
showDelegateNoAccessModal();
});
return;
}
if (isAccountLocked) {
closeModal(() => showLockedAccountModal());
return;
Expand All @@ -637,12 +621,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
title={translate('common.delete')}
icon={Expensicons.Trashcan}
onPress={() => {
if (isActingAsDelegate) {
closeModal(() => {
showDelegateNoAccessModal();
});
return;
}
if (isAccountLocked) {
closeModal(() => showLockedAccountModal());
return;
Expand All @@ -656,12 +634,6 @@ function WalletPage({shouldListenForResize = false}: WalletPageProps) {
title={translate('common.enableGlobalReimbursements')}
icon={Expensicons.Globe}
onPress={() => {
if (isActingAsDelegate) {
closeModal(() => {
showDelegateNoAccessModal();
});
return;
}
if (isAccountLocked) {
closeModal(() => showLockedAccountModal());
return;
Expand Down