Skip to content

Commit

Permalink
fix: prevent showing notification errors for dev for known emoji reac…
Browse files Browse the repository at this point in the history
…tion types (#2704)
  • Loading branch information
shuuji3 committed Mar 19, 2024
1 parent 9251ec4 commit e9ab0cd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/notification/NotificationCard.vue
Expand Up @@ -4,6 +4,13 @@ import type { mastodon } from 'masto'
const { notification } = defineProps<{
notification: mastodon.v1.Notification
}>()
const { t } = useI18n()
// well-known emoji reactions types Elk does not support yet
const unsupportedEmojiReactionTypes = ['pleroma:emoji_reaction', 'reaction']
if (unsupportedEmojiReactionTypes.includes(notification.type))
console.warn(`[DEV] ${t('notification.missing_type')} '${notification.type}' (notification.id: ${notification.id})`)
</script>

<template>
Expand Down Expand Up @@ -88,7 +95,8 @@ const { notification } = defineProps<{
<template v-else-if="notification.type === 'mention' || notification.type === 'poll' || notification.type === 'status'">
<StatusCard :status="notification.status!" />
</template>
<template v-else>
<template v-else-if="!unsupportedEmojiReactionTypes.includes(notification.type)">
<!-- prevent showing errors for dev for known emoji reaction types -->
<!-- type 'favourite' and 'reblog' should always rendered by NotificationGroupedLikes -->
<div text-red font-bold>
[DEV] {{ $t('notification.missing_type') }} '{{ notification.type }}'
Expand Down

0 comments on commit e9ab0cd

Please sign in to comment.