Skip to content

Commit

Permalink
rename param
Browse files Browse the repository at this point in the history
  • Loading branch information
Puneet-here authored Dec 30, 2022
1 parent e24e3c8 commit dcf5c04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libs/EmojiUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ function addToFrequentlyUsedEmojis(frequentlyUsedEmojis, newEmoji) {
/**
* Replace any emoji name in a text with the emoji icon
* @param {String} text
* @param {Boolean} addSpace
* @param {Boolean} isSmallScreenWidth
* @returns {String}
*/
function replaceEmojis(text, addSpace = false) {
function replaceEmojis(text, isSmallScreenWidth = false) {
let newText = text;
const emojiData = text.match(CONST.REGEX.EMOJI_NAME);
if (!emojiData || emojiData.length === 0) {
Expand All @@ -202,7 +202,7 @@ function replaceEmojis(text, addSpace = false) {

// If this is the last emoji in the message and it's the end of the message so far,
// add a space after it so the user can keep typing easily.
if (addSpace && i === emojiData.length - 1 && text.endsWith(emojiData[i])) {
if (isSmallScreenWidth && i === emojiData.length - 1 && text.endsWith(emojiData[i])) {
emojiReplacement += ' ';
}
newText = newText.replace(emojiData[i], emojiReplacement);
Expand Down

0 comments on commit dcf5c04

Please sign in to comment.