diff --git a/packages/pl-fe/src/normalizers/poll.ts b/packages/pl-fe/src/normalizers/poll.ts index 5dc410b21..395d9e574 100644 --- a/packages/pl-fe/src/normalizers/poll.ts +++ b/packages/pl-fe/src/normalizers/poll.ts @@ -21,7 +21,7 @@ const normalizePoll = (poll: Exclude) => { }; }; -const normalizePollEdit = (poll: Exclude, emojis?: Array) => { +const normalizePollEdit = (poll: Exclude, emojis: Array) => { const emojiMap = makeEmojiMap(emojis); return { ...poll, diff --git a/packages/pl-fe/src/normalizers/status-edit.ts b/packages/pl-fe/src/normalizers/status-edit.ts index c2ac254f1..80809dc79 100644 --- a/packages/pl-fe/src/normalizers/status-edit.ts +++ b/packages/pl-fe/src/normalizers/status-edit.ts @@ -13,7 +13,7 @@ import type { StatusEdit as BaseStatusEdit } from 'pl-api'; const normalizeStatusEdit = (statusEdit: BaseStatusEdit) => { const emojiMap = makeEmojiMap(statusEdit.emojis); - const poll = statusEdit.poll ? normalizePollEdit(statusEdit.poll) : null; + const poll = statusEdit.poll ? normalizePollEdit(statusEdit.poll, statusEdit.emojis) : null; return { ...statusEdit, diff --git a/packages/pl-fe/src/utils/normalizers.ts b/packages/pl-fe/src/utils/normalizers.ts index f7d2ce76f..5c9f897cb 100644 --- a/packages/pl-fe/src/utils/normalizers.ts +++ b/packages/pl-fe/src/utils/normalizers.ts @@ -1,4 +1,6 @@ -const makeEmojiMap = (emojis: any) => emojis.reduce((obj: any, emoji: any) => { +import type { CustomEmoji } from 'pl-api'; + +const makeEmojiMap = (emojis: Array) => emojis.reduce((obj: Record, emoji: CustomEmoji) => { obj[`:${emoji.shortcode}:`] = emoji; return obj; }, {});