From d78e15cc1a4166d6f08ab4914a6d9ec61d8a33da Mon Sep 17 00:00:00 2001 From: tamaina Date: Fri, 3 Feb 2023 20:37:15 +0000 Subject: [PATCH] =?UTF-8?q?fix(client):=20=E3=82=AB=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=83=A0=E7=B5=B5=E6=96=87=E5=AD=97=E3=81=AB=E3=82=A2=E3=83=8B?= =?UTF-8?q?=E3=83=A1=E3=83=BC=E3=82=B7=E3=83=A7=E3=83=B3=E7=94=BB=E5=83=8F?= =?UTF-8?q?=E3=82=92=E5=86=8D=E7=94=9F=E3=81=97=E3=81=AA=E3=81=84=E8=A8=AD?= =?UTF-8?q?=E5=AE=9A=E3=81=8C=E9=81=A9=E7=94=A8=E3=81=95=E3=82=8C=E3=81=A6?= =?UTF-8?q?=E3=81=84=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ .../src/components/global/MkCustomEmoji.vue | 22 +++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36d9fcc4f..8dca1170d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,9 @@ You should also include the user name that made the change. ### Improvements - ロールで広告の非表示が有効になっている場合は最初から広告を非表示にするように +### Bugfixes +- Client: カスタム絵文字にアニメーション画像を再生しない設定が適用されていない問題を修正 + ## 13.2.6 (2023/02/01) ### Changes - docker-compose.ymlをdocker-compose.yml.exampleにしました。docker-compose.ymlとしてコピーしてから使用してください。 diff --git a/packages/frontend/src/components/global/MkCustomEmoji.vue b/packages/frontend/src/components/global/MkCustomEmoji.vue index 93c47f0c2..e6dedd035 100644 --- a/packages/frontend/src/components/global/MkCustomEmoji.vue +++ b/packages/frontend/src/components/global/MkCustomEmoji.vue @@ -18,19 +18,23 @@ const props = defineProps<{ }>(); const customEmojiName = computed(() => (props.name[0] === ':' ? props.name.substr(1, props.name.length - 2) : props.name).replace('@.', '')); -const url = computed(() => { + +const rawUrl = computed(() => { if (props.url) { return props.url; - } else if (props.host == null && !customEmojiName.value.includes('@')) { - const found = customEmojis.value.find(x => x.name === customEmojiName.value); - return found ? defaultStore.state.disableShowingAnimatedImages ? getStaticImageUrl(found.url) : found.url : null; - } else { - const rawUrl = props.host ? `/emoji/${customEmojiName.value}@${props.host}.webp` : `/emoji/${customEmojiName.value}.webp`; - return defaultStore.state.disableShowingAnimatedImages - ? getStaticImageUrl(rawUrl) - : rawUrl; } + if (props.host == null && !customEmojiName.value.includes('@')) { + return customEmojis.value.find(x => x.name === customEmojiName.value)?.url || null; + } + return props.host ? `/emoji/${customEmojiName.value}@${props.host}.webp` : `/emoji/${customEmojiName.value}.webp`; }); + +const url = computed(() => + defaultStore.reactiveState.disableShowingAnimatedImages.value && rawUrl.value + ? getStaticImageUrl(rawUrl.value) + : rawUrl.value +); + const alt = computed(() => `:${customEmojiName.value}:`); let errored = $ref(url.value == null);