summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2024-03-02 13:26:21 +0900
committerGitHub <noreply@github.com>2024-03-02 13:26:21 +0900
commit114d3319e819aa920e21c91034c46ece9afd5d3d (patch)
tree40b5847eca72bba548dcb9467d78301a0536ebea
parentfix: emoji colorization (diff)
downloadmisskey-114d3319e819aa920e21c91034c46ece9afd5d3d.tar.gz
misskey-114d3319e819aa920e21c91034c46ece9afd5d3d.tar.bz2
misskey-114d3319e819aa920e21c91034c46ece9afd5d3d.zip
chore(client): 絵文字の画像読み込みに失敗した際はテキストではなくダミー画像を表示 (#13487)
-rw-r--r--packages/frontend/src/components/global/MkCustomEmoji.stories.impl.ts7
-rw-r--r--packages/frontend/src/components/global/MkCustomEmoji.vue7
2 files changed, 13 insertions, 1 deletions
diff --git a/packages/frontend/src/components/global/MkCustomEmoji.stories.impl.ts b/packages/frontend/src/components/global/MkCustomEmoji.stories.impl.ts
index e0da6a4a13..2e791e991e 100644
--- a/packages/frontend/src/components/global/MkCustomEmoji.stories.impl.ts
+++ b/packages/frontend/src/components/global/MkCustomEmoji.stories.impl.ts
@@ -48,3 +48,10 @@ export const Missing = {
name: Default.args.name,
},
} satisfies StoryObj<typeof MkCustomEmoji>;
+export const Error = {
+ ...Default,
+ args: {
+ url: 'https://example.com/404',
+ name: Default.args.name,
+ },
+} satisfies StoryObj<typeof MkCustomEmoji>;
diff --git a/packages/frontend/src/components/global/MkCustomEmoji.vue b/packages/frontend/src/components/global/MkCustomEmoji.vue
index dbcb00460c..67927ddd22 100644
--- a/packages/frontend/src/components/global/MkCustomEmoji.vue
+++ b/packages/frontend/src/components/global/MkCustomEmoji.vue
@@ -4,7 +4,12 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
-<span v-if="errored">:{{ customEmojiName }}:</span>
+<img
+ v-if="errored"
+ :class="[$style.root, { [$style.normal]: normal, [$style.noStyle]: noStyle }]"
+ src="/client-assets/dummy.png"
+ :title="alt"
+/>
<img
v-else
:class="[$style.root, { [$style.normal]: normal, [$style.noStyle]: noStyle }]"