Skip to content

Commit

Permalink
Merge pull request #51571 from callstack-internal/fix/51570-default-c…
Browse files Browse the repository at this point in the history
…ard-name-in-settings

[NoQA] fix: show default feed name in settings
  • Loading branch information
mountiny authored Nov 1, 2024
2 parents cb28419 + b05ce87 commit bfce277
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function WorkspaceCompanyCardsSettingsFeedNamePage({
const [lastSelectedFeed] = useOnyx(`${ONYXKEYS.COLLECTION.LAST_SELECTED_FEED}${policyID}`);
const [cardFeeds] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${workspaceAccountID}`);
const selectedFeed = CardUtils.getSelectedFeed(lastSelectedFeed, cardFeeds);
const feedName = cardFeeds?.settings?.companyCardNicknames?.[selectedFeed] ?? '';
const feedName = cardFeeds?.settings?.companyCardNicknames?.[selectedFeed] ?? translate('workspace.companyCards.feedName', {feedName: CardUtils.getCardFeedName(selectedFeed)});

const validate = useCallback(
(values: FormOnyxValues<typeof ONYXKEYS.FORMS.WORKSPACE_COMPANY_CARD_FEED_NAME>) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function WorkspaceCompanyCardsSettingsPage({
const [cardFeeds] = useOnyx(`${ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_DOMAIN_MEMBER}${workspaceAccountID}`);
const [lastSelectedFeed] = useOnyx(`${ONYXKEYS.COLLECTION.LAST_SELECTED_FEED}${policyID}`);
const selectedFeed = CardUtils.getSelectedFeed(lastSelectedFeed, cardFeeds);
const feedName = cardFeeds?.settings?.companyCardNicknames?.[selectedFeed] ?? '';
const feedName = cardFeeds?.settings?.companyCardNicknames?.[selectedFeed] ?? translate('workspace.companyCards.feedName', {feedName: CardUtils.getCardFeedName(selectedFeed)});
const liabilityType = cardFeeds?.settings?.companyCards?.[selectedFeed]?.liabilityType;
const isPersonal = liabilityType === CONST.COMPANY_CARDS.DELETE_TRANSACTIONS.ALLOW;

Expand Down

0 comments on commit bfce277

Please sign in to comment.