Fixed: force a name when downloading a document without filename

see https://gitlab.com/champs-libres/departement-de-la-vendee/accent-suivi-developpement/-/issues/1005
This commit is contained in:
2023-03-09 18:01:39 +01:00
parent cc98f64be5
commit 78858e84f2
4 changed files with 10 additions and 9 deletions

View File

@@ -38,13 +38,11 @@ async function download_and_open(event: Event): Promise<void> {
button.href = window.URL.createObjectURL(raw);
button.type = props.storedObject.type;
if (props.filename !== undefined) {
button.download = props.filename || 'document';
button.download = props.filename || 'document';
const ext = mime.getExtension(props.storedObject.type);
if (null !== ext) {
button.download = button.download + '.' + ext;
}
const ext = mime.getExtension(props.storedObject.type);
if (null !== ext) {
button.download = button.download + '.' + ext;
}
}