Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Workspace Feeds] Hide request limit button if the settlement account was connected via Plaid #48984

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ function WorkspaceCardsListLabel({type, value, style}: WorkspaceCardsListLabelPr
const [cardSettings] = useOnyx(`${ONYXKEYS.COLLECTION.PRIVATE_EXPENSIFY_CARD_SETTINGS}${workspaceAccountID}`);
const paymentBankAccountID = cardSettings?.paymentBankAccountID;

const isConnectedWithPlaid = useMemo(() => !!bankAccountList?.[paymentBankAccountID ?? 0]?.accountData?.additionalData?.plaidAccountID, [bankAccountList, paymentBankAccountID]);
const isConnectedWithPlaid = useMemo(() => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add a comment here explaining why we fallback on bankAccountData?.additionalData?.plaidAccountID and also include a link to the clean up issue #47944?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MariaHCD Updated in 1a2c742. Let me know what do you think

const bankAccountData = bankAccountList?.[paymentBankAccountID ?? 0]?.accountData;
return !!bankAccountData?.plaidAccountID || !!bankAccountData?.additionalData?.plaidAccountID;
}, [bankAccountList, paymentBankAccountID]);

useEffect(() => {
if (!anchorRef.current || !isVisible) {
Expand Down
3 changes: 3 additions & 0 deletions src/types/onyx/AccountData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ type AccountData = {
/** The bankAccountID in the bankAccounts db */
bankAccountID?: number;

/** Unique identifier for this account in Plaid */
plaidAccountID?: string;

/** All data related to the bank account */
additionalData?: BankAccountAdditionalData;

Expand Down
Loading