diff --git a/packages/pl-fe/package.json b/packages/pl-fe/package.json index 75262306a..28837b1f9 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 d6fe9f49e..4273d44c9 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;