fix(frontend): use logical OR for fallback of file comment (#17089)
This commit is contained in:
parent
f3aa5081ed
commit
4a0edf348a
|
|
@ -15,7 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
>
|
>
|
||||||
<template #header>{{ file.name }}</template>
|
<template #header>{{ file.name }}</template>
|
||||||
<div :class="$style.container">
|
<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>
|
</div>
|
||||||
</MkModalWindow>
|
</MkModalWindow>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
||||||
|
|
@ -107,8 +107,10 @@ onMounted(() => {
|
||||||
src: media.url,
|
src: media.url,
|
||||||
w: media.properties.width,
|
w: media.properties.width,
|
||||||
h: media.properties.height,
|
h: media.properties.height,
|
||||||
alt: media.comment ?? media.name,
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||||
comment: media.comment ?? media.name,
|
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) {
|
if (media.properties.orientation != null && media.properties.orientation >= 5) {
|
||||||
[item.w, item.h] = [item.h, item.w];
|
[item.w, item.h] = [item.h, item.w];
|
||||||
|
|
@ -155,8 +157,10 @@ onMounted(() => {
|
||||||
[itemData.w, itemData.h] = [itemData.h, itemData.w];
|
[itemData.w, itemData.h] = [itemData.h, itemData.w];
|
||||||
}
|
}
|
||||||
itemData.msrc = file.thumbnailUrl ?? undefined;
|
itemData.msrc = file.thumbnailUrl ?? undefined;
|
||||||
itemData.alt = file.comment ?? file.name;
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||||
itemData.comment = file.comment ?? file.name;
|
itemData.alt = file.comment || file.name;
|
||||||
|
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
|
||||||
|
itemData.comment = file.comment || file.name;
|
||||||
itemData.thumbCropped = true;
|
itemData.thumbCropped = true;
|
||||||
|
|
||||||
return itemData;
|
return itemData;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue