use blob instead of file

for iOS 9
This commit is contained in:
casperlamboo 2018-01-31 14:17:21 +01:00
parent 3b99a3c494
commit 491067b070

View File

@ -188,16 +188,16 @@ export async function slice(target, name, mesh, settings, updateProgress) {
switch (target) { switch (target) {
case 'DOWNLOAD': { case 'DOWNLOAD': {
const blob = new File([gcode], `${name}.gcode`, { type: 'text/plain' }); const file = new Blob([gcode], { type: 'text/plain' });
fileSaver.saveAs(blob); fileSaver.saveAs(file, `${name}.gcode`);
break; break;
} }
case 'WIFI': { case 'WIFI': {
if (settings.printer === 'doodle3d_printer') { if (settings.printer === 'doodle3d_printer') {
const body = new FormData(); const body = new FormData();
const file = new File([gcode], 'doodle.gcode', { type: 'plain/text' }); const file = new Blob([gcode], { type: 'plain/text' });
body.append('file', file); body.append('file', file, 'doodle.gcode');
// because fetch has no way of retrieving progress we fake progress // because fetch has no way of retrieving progress we fake progress
let loaded = 0; let loaded = 0;