Skip to content

Commit

Permalink
🐛 Fix event ICS download button file content (#1390)
Browse files Browse the repository at this point in the history
  • Loading branch information
smncd authored Oct 11, 2024
1 parent e592484 commit 71dc64a
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/web/src/components/add-to-calendar-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,11 @@ export function AddToCalendarButton({
<DropdownMenuSeparator />
<DropdownMenuItem
onClick={() => {
const res = ics(calendarEvent);
const data = ics(calendarEvent);

// download the file
const blob = new Blob([res], { type: "text/calendar" });
const url = URL.createObjectURL(blob);
const link = document.createElement("a");
link.setAttribute("href", url);
link.setAttribute("href", data);
link.setAttribute(
"download",
`${title.toLocaleLowerCase().replace(/\s/g, "-")}.ics`,
Expand Down

0 comments on commit 71dc64a

Please sign in to comment.