Skip to content
This repository was archived by the owner on Jun 27, 2026. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 4 additions & 11 deletions src/ExportView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,10 @@ const ExportView: React.FC<{ plan: Plan }> = ({ plan }) => {
const jsonText = JSON.stringify(toJSON(plan));
const [url, setURL] = useState<string | undefined>();
useEffect(() => {
const blob = new Blob([jsonText], { type: 'application/json' });
const reader = new FileReader();
const onLoad = () => {
const url = reader.result;
if (typeof url === 'string') {
setURL(url);
}
}
reader.addEventListener('load', onLoad);
reader.readAsDataURL(blob);
return () => reader.removeEventListener('load', onLoad);
const blob = new Blob([jsonText], { type: 'application/json' })
const url = URL.createObjectURL(blob);
setURL(url);
return () => URL.revokeObjectURL(url);
}, [jsonText]);

return (
Expand Down