Skip to content

Commit 3896482

Browse files
MelvinBotmadmax330
andcommitted
Fix: avoid defaulting policyID to empty string to satisfy no-default-id-values lint rule
Co-authored-by: Maxence Coulibaly <madmax330@users.noreply.github.com>
1 parent b3a3dbc commit 3896482

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hooks/useIsAllowedToIssueCompanyCard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ function useIsAllowedToIssueCompanyCard({policyID}: {policyID?: string}) {
2020
const selectedFeedData = selectedFeed && companyCards[selectedFeed];
2121
const [domain] = useOnyx(`${ONYXKEYS.COLLECTION.DOMAIN}${selectedFeedData?.domainID}`);
2222

23-
if (selectedFeedData?.domainID === policy?.workspaceAccountID || selectedFeedData?.linkedPolicyIDs?.includes(policyID ?? '')) {
23+
if (selectedFeedData?.domainID === policy?.workspaceAccountID || (policyID && selectedFeedData?.linkedPolicyIDs?.includes(policyID))) {
2424
return isPolicyAdmin;
2525
}
2626

0 commit comments

Comments
 (0)