Skip to content

Commit 49d7fa5

Browse files
committed
fix: show feed selector RBR only for other broken feeds
The feed selector button previously showed RBR based on the currently selected feed's errors. This caused missing RBR when another feed had a broken connection, and extra RBR when only the selected feed was broken. The selector now checks if any other feed has errors, since the current feed's issues are already visible via the error banner.
1 parent 9317075 commit 49d7fa5

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/pages/workspace/companyCards/WorkspaceCompanyCardsTable/WorkspaceCompanyCardsTableHeaderButtons.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,11 @@ function WorkspaceCompanyCardsTableHeaderButtons({policyID, feedName, isLoading,
6767
const [countryByIp] = useOnyx(ONYXKEYS.COUNTRY);
6868
const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
6969

70-
const {cardFeedErrors} = useCardFeedErrors();
70+
const {cardFeedErrors, shouldShowRbrForFeedNameWithDomainID} = useCardFeedErrors();
7171
const feedErrors = cardFeedErrors[feedName];
7272
const hasFeedErrors = feedErrors?.hasFeedErrors;
7373
const isFeedConnectionBroken = feedErrors?.isFeedConnectionBroken;
74-
const shouldShowRBR = feedErrors?.shouldShowRBR;
74+
const hasOtherFeedWithRBR = Object.keys(companyFeeds ?? {}).some((feed) => feed !== feedName && shouldShowRbrForFeedNameWithDomainID[feed]);
7575

7676
const openBankConnection = () => {
7777
if (!feedName) {
@@ -145,7 +145,7 @@ function WorkspaceCompanyCardsTableHeaderButtons({policyID, feedName, isLoading,
145145
CardFeedIcon={CardFeedIcon}
146146
feedName={formattedFeedName}
147147
supportingText={supportingText}
148-
shouldShowRBR={shouldShowRBR}
148+
shouldShowRBR={hasOtherFeedWithRBR}
149149
/>
150150
)}
151151

0 commit comments

Comments
 (0)