mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +00:00
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.
This commit is contained in:
parent
d656ac00a1
commit
915091286a
@ -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,
|
||||
}))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user