mirror of
https://github.com/lukevella/rallly.git
synced 2025-05-02 19:56:05 +02:00
🐛 Fix event ICS download button file content (#1390)
This commit is contained in:
parent
e592484616
commit
71dc64abf5
1 changed files with 2 additions and 4 deletions
|
@ -119,13 +119,11 @@ export function AddToCalendarButton({
|
||||||
<DropdownMenuSeparator />
|
<DropdownMenuSeparator />
|
||||||
<DropdownMenuItem
|
<DropdownMenuItem
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
const res = ics(calendarEvent);
|
const data = ics(calendarEvent);
|
||||||
|
|
||||||
// download the file
|
// download the file
|
||||||
const blob = new Blob([res], { type: "text/calendar" });
|
|
||||||
const url = URL.createObjectURL(blob);
|
|
||||||
const link = document.createElement("a");
|
const link = document.createElement("a");
|
||||||
link.setAttribute("href", url);
|
link.setAttribute("href", data);
|
||||||
link.setAttribute(
|
link.setAttribute(
|
||||||
"download",
|
"download",
|
||||||
`${title.toLocaleLowerCase().replace(/\s/g, "-")}.ics`,
|
`${title.toLocaleLowerCase().replace(/\s/g, "-")}.ics`,
|
||||||
|
|
Loading…
Add table
Reference in a new issue