Skip to content

Commit 8c85120

Browse files
LukasModclaude
andcommitted
refactor: ReportActionItemEmojiReactions, self-subscribe to locale
Drop the unused preferredLocale prop and read it from useLocalize() inside the component. The prop was never threaded through PureReportActionItem, so the component was silently falling back to CONST.LOCALES.DEFAULT — this change fixes that latent bug and removes one prop from the interface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent eb6faf4 commit 8c85120

1 file changed

Lines changed: 4 additions & 12 deletions

File tree

src/components/Reactions/ReportActionItemEmojiReactions.tsx

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import type {Emoji} from '@assets/emojis/types';
66
import OfflineWithFeedback from '@components/OfflineWithFeedback';
77
import Tooltip from '@components/Tooltip/PopoverAnchorTooltip';
88
import useCurrentUserPersonalDetails from '@hooks/useCurrentUserPersonalDetails';
9+
import useLocalize from '@hooks/useLocalize';
910
import useOnyx from '@hooks/useOnyx';
1011
import useThemeStyles from '@hooks/useThemeStyles';
1112
import {getEmojiReactionDetails, getLocalizedEmojiName} from '@libs/EmojiUtils';
@@ -16,7 +17,7 @@ import {toggleEmojiReaction} from '@userActions/Report';
1617
import {isAnonymousUser, signOutAndRedirectToSignIn} from '@userActions/Session';
1718
import CONST from '@src/CONST';
1819
import ONYXKEYS from '@src/ONYXKEYS';
19-
import type {Locale, ReportAction, ReportActionReactions} from '@src/types/onyx';
20+
import type {ReportAction, ReportActionReactions} from '@src/types/onyx';
2021
import type {PendingAction} from '@src/types/onyx/OnyxCommon';
2122
import AddReactionBubble from './AddReactionBubble';
2223
import EmojiReactionBubble from './EmojiReactionBubble';
@@ -26,9 +27,6 @@ type ReportActionItemEmojiReactionsProps = {
2627
/** All the emoji reactions for the report action. */
2728
emojiReactions: OnyxEntry<ReportActionReactions>;
2829

29-
/** The user's preferred locale. */
30-
preferredLocale?: OnyxEntry<Locale>;
31-
3230
/** The report action that these reactions are for */
3331
reportAction: ReportAction;
3432

@@ -75,15 +73,9 @@ type FormattedReaction = {
7573
setIsEmojiPickerActive?: (state: boolean) => void;
7674
};
7775

78-
function ReportActionItemEmojiReactions({
79-
reportAction,
80-
reportID,
81-
emojiReactions = {},
82-
shouldBlockReactions = false,
83-
preferredLocale = CONST.LOCALES.DEFAULT,
84-
setIsEmojiPickerActive,
85-
}: ReportActionItemEmojiReactionsProps) {
76+
function ReportActionItemEmojiReactions({reportAction, reportID, emojiReactions = {}, shouldBlockReactions = false, setIsEmojiPickerActive}: ReportActionItemEmojiReactionsProps) {
8677
const styles = useThemeStyles();
78+
const {preferredLocale} = useLocalize();
8779
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
8880
const reactionListRef = useContext(ReactionListContext);
8981
const popoverReactionListAnchors = useRef<PopoverReactionListAnchors>({});

0 commit comments

Comments
 (0)