From 0b2f945bb61fc5c3a33ab93d0134f4bfe3a05c9d Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 22 Jan 2023 15:13:03 +0000 Subject: [PATCH] wip --- .../backend/src/server/api/endpoints/admin/emoji/update.ts | 2 +- packages/frontend/src/custom-emojis.ts | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts index 6c4c8d0e6..22bedc710 100644 --- a/packages/backend/src/server/api/endpoints/admin/emoji/update.ts +++ b/packages/backend/src/server/api/endpoints/admin/emoji/update.ts @@ -76,7 +76,7 @@ export default class extends Endpoint { }); } else { this.globalEventService.publishBroadcastStream('emojiDeleted', { - emojis: [ emoji ], + emojis: [ await this.emojiEntityService.pack(emoji) ], }); this.globalEventService.publishBroadcastStream('emojiAdded', { diff --git a/packages/frontend/src/custom-emojis.ts b/packages/frontend/src/custom-emojis.ts index 5b13176cd..b080eca40 100644 --- a/packages/frontend/src/custom-emojis.ts +++ b/packages/frontend/src/custom-emojis.ts @@ -17,7 +17,9 @@ export const customEmojiCategories = computed(() => { fetchCustomEmojis(); stream.on('emojiAdded', emojiData => { - customEmojis.value = [ emojiData.emoji, ...customEmojis.value ] + setTimeout(() => { + customEmojis.value = [ emojiData.emoji, ...customEmojis.value ] + }, 100); }); stream.on('emojiUpdated', emojiData => { @@ -25,7 +27,7 @@ stream.on('emojiUpdated', emojiData => { }); stream.on('emojiDeleted', emojiData => { - customEmojis.value = customEmojis.value.filter(item => !emojiData.emojis.some(search => search.name === item.name)) + customEmojis.value = customEmojis.value.filter(item => !emojiData.emojis.some(search => search.name === item.name)); }); export async function fetchCustomEmojis() {