Skip to content

Commit e7c66ea

Browse files
committed
fix: Individual workspace is in 'Send from' field
1 parent 420c2a1 commit e7c66ea

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/libs/actions/Policy/Policy.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,8 +206,7 @@ function getPolicy(policyID: string | undefined): OnyxEntry<Policy> {
206206
// TODO: Use getInvoicePrimaryWorkspace when the invoices screen is ready - https://github.com/Expensify/App/issues/45175.
207207
function getPrimaryPolicy(activePolicyID?: OnyxEntry<string>): Policy | undefined {
208208
const activeAdminWorkspaces = PolicyUtils.getActiveAdminWorkspaces(allPolicies);
209-
const primaryPolicy: Policy | null | undefined = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${activePolicyID ?? '-1'}`];
210-
209+
const primaryPolicy: Policy | null | undefined = activeAdminWorkspaces.find((policy) => policy.id === activePolicyID);
211210
return primaryPolicy ?? activeAdminWorkspaces[0];
212211
}
213212

0 commit comments

Comments
 (0)