From 915091286a8e1be11974762a5a931833eb6f84ef Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 19 Jun 2025 13:03:22 +0200 Subject: [PATCH] Keep correct file extension for audio captures (voice chat) (#8687) Problem: When audio is directly recorded to chat, it has the correct file extension in its name ("audio.mp3"). The file object we get doesn't have an extension property though, so the file name after our modification would be "audio.mp3.undefined". Safari doesn't accept this as audio source, and I hate to say it, but I agree. So if there is no extension, keep the existing one. Problem solved. --- webapp/components/Chat/Chat.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp/components/Chat/Chat.vue b/webapp/components/Chat/Chat.vue index 9fff020f1..893b6164f 100644 --- a/webapp/components/Chat/Chat.vue +++ b/webapp/components/Chat/Chat.vue @@ -376,7 +376,11 @@ export default { const filesToUpload = hasFiles ? files.map((file) => ({ - upload: new File([file.blob], `${file.name}.${file.extension}`), + upload: new File( + [file.blob], + // Captured audio already has the right extension in the name + file.extension ? `${file.name}.${file.extension}` : file.name, + ), name: file.name, type: file.type, }))