Display toast after reacting emoji reaction limit (#10799)
This commit is contained in:
@@ -6,8 +6,10 @@ import {
|
||||
type ModerationOpts,
|
||||
RichText,
|
||||
} from '@atproto/api'
|
||||
import {plural} from '@lingui/core/macro'
|
||||
import {useLingui} from '@lingui/react/macro'
|
||||
|
||||
import {EMOJI_REACTION_LIMIT} from '#/lib/constants'
|
||||
import {useGoogleTranslate} from '#/lib/hooks/useGoogleTranslate'
|
||||
import {richTextToString} from '#/lib/strings/rich-text-helpers'
|
||||
import {useMaybeProfileShadow} from '#/state/cache/profile-shadow'
|
||||
@@ -98,7 +100,18 @@ export let MessageContextMenu = ({
|
||||
.removeReaction(message.id, emoji)
|
||||
.catch(() => Toast.show(l`Failed to remove emoji reaction`))
|
||||
} else {
|
||||
if (hasReachedReactionLimit(message, currentAccount?.did)) return
|
||||
if (hasReachedReactionLimit(message, currentAccount?.did)) {
|
||||
Toast.show(
|
||||
l`You cannot add more than ${plural(EMOJI_REACTION_LIMIT, {
|
||||
one: '# emoji reaction',
|
||||
other: '# emoji reactions',
|
||||
})}`,
|
||||
{
|
||||
type: 'info',
|
||||
},
|
||||
)
|
||||
return
|
||||
}
|
||||
convo.addReaction(message.id, emoji).catch(() =>
|
||||
Toast.show(l`Failed to add emoji reaction`, {
|
||||
type: 'error',
|
||||
|
||||
Reference in New Issue
Block a user