From bd142b8fe5f0a7d0a1cce1a1bc9b93ca59435ed6 Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 6 Apr 2023 10:12:30 +0900 Subject: [PATCH] refactor --- packages/backend/src/core/activitypub/models/ApNoteService.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/core/activitypub/models/ApNoteService.ts b/packages/backend/src/core/activitypub/models/ApNoteService.ts index 2665e8534..5ca5f6e84 100644 --- a/packages/backend/src/core/activitypub/models/ApNoteService.ts +++ b/packages/backend/src/core/activitypub/models/ApNoteService.ts @@ -345,11 +345,11 @@ export class ApNoteService { const existingEmojis = await this.emojisRepository.findBy({ host, - name: In(eomjiTags.map(tag => tag.name!.replace(/^:/, '').replace(/:$/, ''))), + name: In(eomjiTags.map(tag => tag.name!.replaceAll(':', ''))), }); return await Promise.all(eomjiTags.map(async tag => { - const name = tag.name!.replace(/^:/, '').replace(/:$/, ''); + const name = tag.name!.replaceAll(':', ''); tag.icon = toSingle(tag.icon); const exists = existingEmojis.find(x => x.name === name);