feat(backend): likeOnlyなどでハートにフォールバックする際異体字セレクタがない方に揃える (#13299)

* feat(backend): likeOnlyなどでハートにフォールバックする際異体字セレクタがない方に揃える

close #13298

* Update ReactionService.ts

* chore(backend): prefer single quote for string literal
This commit is contained in:
Kisaragi 2024-02-16 14:25:48 +09:00 committed by GitHub
parent 0c10d2aa64
commit 147e8f1e3e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -30,12 +30,12 @@ import { RoleService } from '@/core/RoleService.js';
import { FeaturedService } from '@/core/FeaturedService.js';
import { trackPromise } from '@/misc/promise-tracker.js';
const FALLBACK = '';
const FALLBACK = '\u2764';
const PER_NOTE_REACTION_USER_PAIR_CACHE_MAX = 16;
const legacies: Record<string, string> = {
'like': '👍',
'love': '❤', // ここに記述する場合は異体字セレクタを入れない
'love': '\u2764', // ハート、異体字セレクタを入れない
'laugh': '😆',
'hmm': '🤔',
'surprise': '😮',
@ -120,7 +120,7 @@ export class ReactionService {
let reaction = _reaction ?? FALLBACK;
if (note.reactionAcceptance === 'likeOnly' || ((note.reactionAcceptance === 'likeOnlyForRemote' || note.reactionAcceptance === 'nonSensitiveOnlyForLocalLikeOnlyForRemote') && (user.host != null))) {
reaction = '❤️';
reaction = '\u2764';
} else if (_reaction) {
const custom = reaction.match(isCustomEmojiRegexp);
if (custom) {