Skip to content

Commit

Permalink
Fix data export (#33) (#35)
Browse files Browse the repository at this point in the history
This just defers the download to the next event cycle, allowing React
enough time to properly update the href.
  • Loading branch information
RuiNtD authored May 18, 2023
1 parent a27a1c0 commit 046ad1d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/components/account/ExportButton.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ export default function ExportButton() {
const blob = await response.blob();
const blobUrl = URL.createObjectURL(blob);
setExportUrl(blobUrl);
dlButton.current.click();
setTimeout(() => {
dlButton.current.click();
});
toast.success('You can download your data now!');
} else {
toast.error('An error occured, please try again later.');
Expand Down

0 comments on commit 046ad1d

Please sign in to comment.