Skip to content

Commit 5e142be

Browse files
committed
lint fix
1 parent ce87f43 commit 5e142be

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

src/components/LHNOptionsList/OptionRowLHN.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,11 @@ function OptionRowLHN({
108108
: [styles.chatLinkRowPressable, styles.flexGrow1, styles.optionItemAvatarNameWrapper, styles.optionRow, styles.justifyContentCenter],
109109
);
110110

111+
const alternateTextContainsCustomEmojiWithText = useMemo(
112+
() => containsCustomEmojiUtils(optionItem?.alternateText) && !containsOnlyCustomEmoji(optionItem?.alternateText),
113+
[optionItem?.alternateText],
114+
);
115+
111116
if (!optionItem && !isOptionFocused) {
112117
// rendering null as a render item causes the FlashList to render all
113118
// its children and consume significant memory on the first render. We can avoid this by
@@ -137,10 +142,6 @@ function OptionRowLHN({
137142
const contentContainerStyles = isInFocusMode ? [styles.flex1, styles.flexRow, styles.overflowHidden, StyleUtils.getCompactContentContainerStyles()] : [styles.flex1];
138143
const hoveredBackgroundColor = !!styles.sidebarLinkHover && 'backgroundColor' in styles.sidebarLinkHover ? styles.sidebarLinkHover.backgroundColor : theme.sidebar;
139144
const focusedBackgroundColor = styles.sidebarLinkActive.backgroundColor;
140-
const alternateTextContainsCustomEmojiWithText = useMemo(
141-
() => containsCustomEmojiUtils(optionItem.alternateText) && !containsOnlyCustomEmoji(optionItem.alternateText),
142-
[optionItem.alternateText],
143-
);
144145

145146
/**
146147
* Show the ReportActionContextMenu modal popover.
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import {Str} from 'expensify-common';
2-
import {useMemo} from 'react';
32
import {containsCustomEmoji} from '@libs/EmojiUtils';
43

54
/**
@@ -10,6 +9,5 @@ export default function shouldRenderAsText(html: string, text: string): boolean
109
// More info: https://github.com/Expensify/App/pull/35838#issuecomment-1964839350
1110
const htmlWithoutLineBreak = Str.replaceAll(html, '<br />', '\n');
1211
const htmlWithoutEmojiOpenTag = Str.replaceAll(htmlWithoutLineBreak, '<emoji>', '');
13-
const hasCustomEmoji = useMemo(() => containsCustomEmoji(text), [text]);
14-
return Str.replaceAll(htmlWithoutEmojiOpenTag, '</emoji>', '') === text && !hasCustomEmoji;
12+
return Str.replaceAll(htmlWithoutEmojiOpenTag, '</emoji>', '') === text && !containsCustomEmoji(text);
1513
}

0 commit comments

Comments
 (0)