From d433c336d8131c7c44199a8a2c93c1724a88e179 Mon Sep 17 00:00:00 2001
From: dakkar <dakkar@thenautilus.net>
Date: Fri, 12 Jul 2024 11:40:37 +0100
Subject: only require alt-text on image/video/audio - fixes #536

---
 packages/frontend/src/components/MkPostForm.vue | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

(limited to 'packages/frontend/src/components/MkPostForm.vue')

diff --git a/packages/frontend/src/components/MkPostForm.vue b/packages/frontend/src/components/MkPostForm.vue
index cfaaeecc34..48b0193a71 100644
--- a/packages/frontend/src/components/MkPostForm.vue
+++ b/packages/frontend/src/components/MkPostForm.vue
@@ -777,7 +777,9 @@ async function post(ev?: MouseEvent) {
 	if (defaultStore.state.warnMissingAltText) {
 		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) {
 			const { canceled, result } = await os.actions({
-- 
cgit v1.2.3-freya

