merge: only require alt-text on image/video/audio - fixes #536 (!569)

View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/569

Closes #536

Approved-by: Marie <marie@kaifa.ch>
Approved-by: Tess K <me@thvxl.se>
This commit is contained in:
dakkar 2024-07-29 10:42:04 +00:00
commit d52d557ead

View file

@ -777,7 +777,9 @@ async function post(ev?: MouseEvent) {
if (defaultStore.state.warnMissingAltText) { if (defaultStore.state.warnMissingAltText) {
const filesData = toRaw(files.value); const filesData = toRaw(files.value);
const isMissingAltText = filesData.some(file => !file.comment); const isMissingAltText = filesData.filter(
file => file.type.startsWith('image/') || file.type.startsWith('video/') || file.type.startsWith('audio/')
).some(file => !file.comment);
if (isMissingAltText) { if (isMissingAltText) {
const { canceled, result } = await os.actions({ const { canceled, result } = await os.actions({