download filename is based on scad filename
This commit is contained in:
parent
e4bd5ef73e
commit
1d4911c153
1 changed files with 3 additions and 2 deletions
|
|
@ -15,8 +15,9 @@ import { confirmDialog } from 'primereact/confirmdialog';
|
|||
|
||||
function downloadOutput(state: State) {
|
||||
if (!state.output) return;
|
||||
|
||||
const fileName = state.output!.isPreview ? 'preview.stl' : 'render.stl';
|
||||
const sourcePathParts = state.params.sourcePath.split('/');
|
||||
const sourceFileName = sourcePathParts.slice(-1)[0];
|
||||
const fileName = [sourceFileName, state.output!.isPreview ? 'preview.stl' : 'render.stl'].join('.');
|
||||
const doDownload = () => {
|
||||
const a = document.createElement('a')
|
||||
a.href = state.output!.stlFileURL
|
||||
|
|
|
|||
Loading…
Reference in a new issue