Skip to content

Commit 6988822

Browse files
authored
Merge pull request Expensify#81796 from s77rt/enable-company-cards-feature-on-new-card-page
Call OpenPolicyAddCardFeedPage on add card feed page
2 parents edaf6c7 + 34a28b3 commit 6988822

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

src/pages/workspace/companyCards/addNew/AddNewCardPage.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,11 @@ function AddNewCardPage({policy}: WithPolicyAndFullscreenLoadingProps) {
6464
}, []);
6565

6666
useEffect(() => {
67-
// If the user only has a domain feed, a workspace account may not have been created yet.
68-
// However, adding a workspace feed requires a workspace account.
69-
// Calling openPolicyAddCardFeedPage will trigger the creation of a workspace account.
70-
if (workspaceAccountID) {
71-
return;
72-
}
67+
// If the user only has a domain feed, then the workspace account may not have been created yet, or the "Company cards" workspace-level feature may not have been enabled yet
68+
// However, adding a workspace feed requires a workspace account with "Company cards" feature enabled.
69+
// Calling openPolicyAddCardFeedPage will trigger the creation of the workspace account (if necessary) and enable the "Company cards" feature (if not enabled).
7370
openPolicyAddCardFeedPage(policyID);
74-
}, [workspaceAccountID, policyID]);
71+
}, [policyID]);
7572

7673
if (isAddCardFeedLoading || isAllFeedsResultLoading || isBlockedToAddNewFeeds) {
7774
return <FullScreenLoadingIndicator />;

0 commit comments

Comments
 (0)