1
0
Fork 0
forked from gitea/nas

Remove redundant variables

This commit is contained in:
KMY 2023-05-27 12:50:42 +09:00
parent a62d454915
commit dee69e4f83
2 changed files with 3 additions and 5 deletions

View file

@ -6,7 +6,7 @@ import { hideRecentEmojis } from 'mastodon/initial_state';
import { useEmoji } from '../../../actions/emojis'; import { useEmoji } from '../../../actions/emojis';
import { changeSetting } from '../../../actions/settings'; import { changeSetting } from '../../../actions/settings';
import { shortCodes } from '../../emoji/emoji_mart_data_light'; import unicodeMapping from '../../emoji/emoji_unicode_mapping_light';
import EmojiPickerDropdown from '../components/emoji_picker_dropdown'; import EmojiPickerDropdown from '../components/emoji_picker_dropdown';
@ -42,11 +42,12 @@ const getFrequentlyUsedEmojis = createSelector([
}; }, }; },
], data => { ], data => {
const { emojiCounters, reactionDeck } = data; const { emojiCounters, reactionDeck } = data;
let deckEmojis = reactionDeck let deckEmojis = reactionDeck
.toArray() .toArray()
.map((e) => e.get('name')) .map((e) => e.get('name'))
.filter((e) => e) .filter((e) => e)
.map((e) => shortCodes[e] || e); .map((e) => unicodeMapping[e] ? unicodeMapping[e].shortCode : e);
deckEmojis = [...new Set(deckEmojis)]; deckEmojis = [...new Set(deckEmojis)];
let emojis; let emojis;

View file

@ -7,7 +7,6 @@ import { unicodeToUnifiedName } from './unicode_to_unified_name';
const [ shortCodesToEmojiData, skins, categories, short_names ] = emojiCompressed; const [ shortCodesToEmojiData, skins, categories, short_names ] = emojiCompressed;
const emojis = {}; const emojis = {};
const shortCodes = {};
// decompress // decompress
Object.keys(shortCodesToEmojiData).forEach((shortCode) => { Object.keys(shortCodesToEmojiData).forEach((shortCode) => {
@ -34,12 +33,10 @@ Object.keys(shortCodesToEmojiData).forEach((shortCode) => {
short_names, short_names,
unified, unified,
}; };
shortCodes[native] = shortCode;
}); });
export { export {
emojis, emojis,
shortCodes,
skins, skins,
categories, categories,
short_names, short_names,