Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 @@ -45,6 +45,11 @@ function WorkspaceCompanyCardsPage({route}: WorkspaceCompanyCardsPageProps) {
const domainOrWorkspaceAccountID = getDomainOrWorkspaceAccountID(workspaceAccountID, selectedFeed);

const loadPolicyCompanyCardsPage = useCallback(() => {
// Skip the API call when workspaceAccountID is 0 -- Onyx discards writes to collection keys with member ID '0'.
if (domainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_ID) {
return;
}

openPolicyCompanyCardsPage(policyID, domainOrWorkspaceAccountID, translate);
}, [domainOrWorkspaceAccountID, policyID, translate]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ function WorkspaceCompanyCardsTable({
const hasNoAssignedCard = Object.keys(assignedCards ?? {}).length === 0;

const areWorkspaceCardFeedsLoading = !!workspaceCardFeedsStatus?.[domainOrWorkspaceAccountID]?.isLoading;
const workspaceCardFeedsErrors = workspaceCardFeedsStatus?.[domainOrWorkspaceAccountID]?.errors;
// Synthesize error locally since Onyx discards writes to collection keys with member ID '0'.
const shouldShowWorkspaceFeedsLoadError = domainOrWorkspaceAccountID === CONST.DEFAULT_NUMBER_ID && isPolicyLoaded && !isOffline;
const workspaceCardFeedsErrors = shouldShowWorkspaceFeedsLoadError
? {[CONST.COMPANY_CARDS.WORKSPACE_FEEDS_LOAD_ERROR]: translate('workspace.companyCards.error.workspaceFeedsCouldNotBeLoadedMessage')}
: workspaceCardFeedsStatus?.[domainOrWorkspaceAccountID]?.errors;

const selectedFeedStatus = selectedFeed?.status;
const selectedFeedErrors = selectedFeedStatus?.errors;
Expand Down
Loading