diff options
| author | poppingmoon <63451158+poppingmoon@users.noreply.github.com> | 2026-01-13 15:04:23 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-13 15:04:23 +0900 |
| commit | 4a0edf348a0ee78e8e8829a2af411329b1687cf9 (patch) | |
| tree | f92376e4aff723a4ca70b5fb55b2f22aac65fb8f | |
| parent | fix(frontend): MkFormで入力に不備がある場合は完了ボタンを... (diff) | |
| download | misskey-4a0edf348a0ee78e8e8829a2af411329b1687cf9.tar.gz misskey-4a0edf348a0ee78e8e8829a2af411329b1687cf9.tar.bz2 misskey-4a0edf348a0ee78e8e8829a2af411329b1687cf9.zip | |
fix(frontend): use logical OR for fallback of file comment (#17089)
| -rw-r--r-- | packages/frontend/src/components/MkImgPreviewDialog.vue | 2 | ||||
| -rw-r--r-- | packages/frontend/src/components/MkMediaList.vue | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/packages/frontend/src/components/MkImgPreviewDialog.vue b/packages/frontend/src/components/MkImgPreviewDialog.vue index 32b36727b0..530b6c45db 100644 --- a/packages/frontend/src/components/MkImgPreviewDialog.vue +++ b/packages/frontend/src/components/MkImgPreviewDialog.vue @@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only > <template #header>{{ file.name }}</template> <div :class="$style.container"> - <img :src="file.url" :alt="file.comment ?? file.name" :class="$style.img"/> + <img :src="file.url" :alt="file.comment || file.name" :class="$style.img"/> </div> </MkModalWindow> </template> diff --git a/packages/frontend/src/components/MkMediaList.vue b/packages/frontend/src/components/MkMediaList.vue index bfc8179e13..b070bfd892 100644 --- a/packages/frontend/src/components/MkMediaList.vue +++ b/packages/frontend/src/components/MkMediaList.vue @@ -107,8 +107,10 @@ onMounted(() => { src: media.url, w: media.properties.width, h: media.properties.height, - alt: media.comment ?? media.name, - comment: media.comment ?? media.name, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + alt: media.comment || media.name, + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + comment: media.comment || media.name, }; if (media.properties.orientation != null && media.properties.orientation >= 5) { [item.w, item.h] = [item.h, item.w]; @@ -155,8 +157,10 @@ onMounted(() => { [itemData.w, itemData.h] = [itemData.h, itemData.w]; } itemData.msrc = file.thumbnailUrl ?? undefined; - itemData.alt = file.comment ?? file.name; - itemData.comment = file.comment ?? file.name; + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + itemData.alt = file.comment || file.name; + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + itemData.comment = file.comment || file.name; itemData.thumbCropped = true; return itemData; |