Skip to content

Commit

Permalink
Autoclean href value for Export button
Browse files Browse the repository at this point in the history
  • Loading branch information
zalmoxisus committed Aug 5, 2016
1 parent 907591d commit 6e0a6a4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/app/components/buttons/ExportButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,17 @@ export default class ExportButton extends Component {
this.setState({ href: 'data:text/json;charset=utf-8,' + state });
}

cleanHref = () => {
setTimeout(() => { this.setState({ href: undefined }); }, 0);
};

render() {
return (
<Button
Icon={DownloadIcon}
onMouseDown={this.handleExport}
download="state.json" href={this.state.href}
onClick={this.cleanHref}
>Export</Button>
);
}
Expand Down

0 comments on commit 6e0a6a4

Please sign in to comment.