From 72acd6252bcd927d5de9e0545629c5c83c204236 Mon Sep 17 00:00:00 2001 From: Abdelhafidh Belalia <16493223+s77rt@users.noreply.github.com> Date: Tue, 6 Aug 2024 02:35:02 +0100 Subject: [PATCH] Wrap onSelected that opens another modal in Modal.close --- src/pages/workspace/accounting/PolicyAccountingPage.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/workspace/accounting/PolicyAccountingPage.tsx b/src/pages/workspace/accounting/PolicyAccountingPage.tsx index 80a2e4c73c70..ea99f3c46b5f 100644 --- a/src/pages/workspace/accounting/PolicyAccountingPage.tsx +++ b/src/pages/workspace/accounting/PolicyAccountingPage.tsx @@ -46,6 +46,7 @@ import type {WithPolicyConnectionsProps} from '@pages/workspace/withPolicyConnec import withPolicyConnections from '@pages/workspace/withPolicyConnections'; import type {AnchorPosition} from '@styles/index'; import {getTrackingCategories} from '@userActions/connections/ConnectToXero'; +import * as Modal from '@userActions/Modal'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -245,7 +246,7 @@ function PolicyAccountingPage({policy}: PolicyAccountingPageProps) { { icon: Expensicons.Trashcan, text: translate('workspace.accounting.disconnect'), - onSelected: () => setIsDisconnectModalOpen(true), + onSelected: () => Modal.close(() => setIsDisconnectModalOpen(true)), }, ], [translate, policyID, isOffline, connectedIntegration],