diff --git a/src/libs/actions/Policy.ts b/src/libs/actions/Policy.ts index 53f5c99c7ffb..cb03b7058fc1 100644 --- a/src/libs/actions/Policy.ts +++ b/src/libs/actions/Policy.ts @@ -2202,9 +2202,39 @@ function openPolicyWorkflowsPage(policyID: string) { return; } + const onyxData: OnyxData = { + optimisticData: [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, + value: { + isLoading: true, + }, + }, + ], + successData: [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, + value: { + isLoading: false, + }, + }, + ], + failureData: [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: `${ONYXKEYS.COLLECTION.POLICY}${policyID}`, + value: { + isLoading: false, + }, + }, + ], + }; + const params: OpenPolicyWorkflowsPageParams = {policyID}; - API.read(READ_COMMANDS.OPEN_POLICY_WORKFLOWS_PAGE, params); + API.read(READ_COMMANDS.OPEN_POLICY_WORKFLOWS_PAGE, params, onyxData); } function setPolicyIDForReimburseView(policyID: string) { diff --git a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx index 6b17cfc46400..f81dd908131a 100644 --- a/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx +++ b/src/pages/workspace/workflows/WorkspaceWorkflowsPage.tsx @@ -85,9 +85,9 @@ function WorkspaceWorkflowsPage({policy, betas, route, session}: WorkspaceWorkfl const optionItems: ToggleSettingOptionRowProps[] = useMemo(() => { const {accountNumber, addressName, bankName} = policy?.achAccount ?? {}; const hasVBA = !!policy?.achAccount; - let bankDisplayName = bankName || addressName; + let bankDisplayName = bankName ?? addressName; if (accountNumber && bankDisplayName !== accountNumber) { - bankDisplayName += ' ' + accountNumber.slice(-5); + bankDisplayName += ` ${accountNumber.slice(-5)}`; } const hasReimburserEmailError = !!policy?.errorFields?.reimburserEmail; const hasApprovalError = !!policy?.errorFields?.approvalMode;