From a70add24af373c39ff74c7275b4f2201e42203e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Wed, 16 Oct 2024 20:22:39 +0200 Subject: [PATCH] pl-fe: Remove fix for custom emojis MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- packages/pl-fe/package.json | 1 - packages/pl-fe/src/reducers/custom-emojis.ts | 22 ++------------------ 2 files changed, 2 insertions(+), 21 deletions(-) diff --git a/packages/pl-fe/package.json b/packages/pl-fe/package.json index 75262306a0..28837b1f94 100644 --- a/packages/pl-fe/package.json +++ b/packages/pl-fe/package.json @@ -132,7 +132,6 @@ "reselect": "^5.1.1", "resize-observer-polyfill": "^1.5.1", "sass": "^1.79.4", - "semver": "^7.6.3", "stringz": "^2.1.0", "tiny-queue": "^0.2.1", "tslib": "^2.7.0", diff --git a/packages/pl-fe/src/reducers/custom-emojis.ts b/packages/pl-fe/src/reducers/custom-emojis.ts index d6fe9f49e3..4273d44c90 100644 --- a/packages/pl-fe/src/reducers/custom-emojis.ts +++ b/packages/pl-fe/src/reducers/custom-emojis.ts @@ -1,5 +1,4 @@ import { buildCustomEmojis } from 'pl-fe/features/emoji'; -import emojiData from 'pl-fe/features/emoji/data'; import { addCustomToPool } from 'pl-fe/features/emoji/search'; import { CUSTOM_EMOJIS_FETCH_SUCCESS, type CustomEmojisAction } from '../actions/custom-emojis'; @@ -8,27 +7,10 @@ import type { CustomEmoji } from 'pl-api'; const initialState: Array = []; -// Populate custom emojis for composer autosuggest -const autosuggestPopulate = (emojis: Array) => { - addCustomToPool(buildCustomEmojis(emojis)); -}; - -const importEmojis = (customEmojis: Array) => { - const emojis = customEmojis.filter((emoji) => { - // If a custom emoji has the shortcode of a Unicode emoji, skip it. - // Otherwise it breaks EmojiMart. - // https://gitlab.com/soapbox-pub/soapbox/-/issues/610 - const shortcode = emoji.shortcode.toLowerCase(); - return !emojiData.emojis[shortcode]; - }); - - autosuggestPopulate(emojis); - return emojis; -}; - const custom_emojis = (state = initialState, action: CustomEmojisAction) => { if (action.type === CUSTOM_EMOJIS_FETCH_SUCCESS) { - return importEmojis(action.custom_emojis); + addCustomToPool(buildCustomEmojis(action.custom_emojis)); + return action.custom_emojis; } return state;