detect whitespaces and return readable filename

This commit is contained in:
Delucse
2020-09-17 13:24:00 +02:00
parent c85c96468c
commit bde430dd40
6 changed files with 26 additions and 6 deletions
+4 -2
View File
@@ -3,6 +3,8 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { workspaceName } from '../actions/workspaceActions';
import { detectWhitespacesAndReturnReadableResult } from '../helpers/whitespace';
import { withStyles } from '@material-ui/core/styles';
import Button from '@material-ui/core/Button';
import Backdrop from '@material-ui/core/Backdrop';
@@ -83,9 +85,9 @@ class Compile extends Component {
download = () => {
const id = this.state.id;
const filename = this.state.name;
const filename = detectWhitespacesAndReturnReadableResult(this.state.name);
this.toggleDialog();
this.props.workspaceName(filename);
this.props.workspaceName(this.state.name);
window.open(`${process.env.REACT_APP_COMPILER_URL}/download?id=${id}&board=${process.env.REACT_APP_BOARD}&filename=${filename}`, '_self');
this.setState({ progress: false });
}