Skip to content

Commit 97c6da5

Browse files
committed
string replace zips
1 parent 6f5ede6 commit 97c6da5

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/app/components/TimeSeriesDialog/DownloadForm.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const DownloadForm = props => {
4040
membership?: string;
4141
name?: string;
4242
public?: boolean;
43-
coords?: string
43+
coords?: string;
4444
}
4545

4646
const [userData, setUserData] = useState<UserData>({
@@ -49,15 +49,18 @@ export const DownloadForm = props => {
4949
membership: '',
5050
name: '',
5151
public: false,
52-
coords: ""
52+
coords: '',
5353
});
5454

5555
const handleChange = values => {
5656
setUserData({ ...userData, ...values });
5757
};
5858

5959
const pushUserData = () => {
60-
api.pushUserData(data.current.series[0].info.coverage_identifier, {...userData, ...{coords: data.current.series[0].info.location}});
60+
api.pushUserData(data.current.series[0].info.coverage_identifier, {
61+
...userData,
62+
...{ coords: data.current.series[0].info.location },
63+
});
6164
};
6265

6366
const refreshSeriesObject =
@@ -241,7 +244,7 @@ export const DownloadForm = props => {
241244
const pu = PapaParse.unparse(
242245
ffdata.values.slice(filterParams.start, filterParams.end + 1),
243246
);
244-
z.file(ffdata.name + '.csv', pu);
247+
z.file(ffdata.name.replaceAll('*', '_') + '.csv', pu);
245248
}
246249
}
247250
}
@@ -289,7 +292,10 @@ export const DownloadForm = props => {
289292
filterParams.start,
290293
filterParams.end + 1,
291294
);
292-
z.file(ffdata.name + '.json', JSON.stringify(ffdata));
295+
z.file(
296+
ffdata.name.replaceAll('*', '_') + '.json',
297+
JSON.stringify(ffdata),
298+
);
293299
}
294300
}
295301
}

0 commit comments

Comments
 (0)