Add experimental fix for bbmodel file extensions on android

This commit is contained in:
JannisX11 2025-02-16 21:59:12 +01:00
parent 41faa51738
commit b7d2dba3e8

View File

@ -310,7 +310,13 @@ Object.assign(Blockbench, {
saveAs(blob, file_name)
} else {
var blob = new Blob([options.content], {type: "text/plain;charset=utf-8"});
let type = 'text/plain;charset=utf-8';
if (file_name.endsWith('json')) {
type = 'application/json;charset=utf-8';
} else if (file_name.endsWith('bbmodel')) {
type = 'model/vnd.blockbench.bbmodel';
}
var blob = new Blob([options.content], {type});
saveAs(blob, file_name, {autoBOM: true})
}