Skip to content

Commit

Permalink
chore(client): 絵文字の画像読み込みに失敗した際はテキストではなくダミー画像を表示 (#13487)
Browse files Browse the repository at this point in the history
  • Loading branch information
tamaina authored Mar 2, 2024
1 parent f704891 commit 114d331
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
7 changes: 6 additions & 1 deletion packages/frontend/src/components/global/MkCustomEmoji.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 }]"
Expand Down

0 comments on commit 114d331

Please sign in to comment.