FIX: correctly pass down calendar options ()

Prior to this fix the options were not passed down when the user had no default calendar.

No test as it's mostly an interaction between discourse-calendar and core which is hard to test.
This commit is contained in:
Joffrey JAFFEUX 2024-03-26 15:09:05 +01:00 committed by GitHub
parent 9c9526f0a8
commit bddc41b7ad
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -4,7 +4,7 @@ import { action } from "@ember/object";
import { service } from "@ember/service";
import { downloadGoogle, downloadIcs } from "discourse/lib/download-calendar";
export default class downloadCalendar extends Component {
export default class DownloadCalendar extends Component {
@service currentUser;
@tracked selectedCalendar = "ics";
@ -23,13 +23,19 @@ export default class downloadCalendar extends Component {
downloadIcs(
this.args.model.calendar.title,
this.args.model.calendar.dates,
this.args.model.calendar.recurrenceRule
{
recurrenceRule: this.args.model.calendar.recurrenceRule,
}
);
} else {
downloadGoogle(
this.args.model.calendar.title,
this.args.model.calendar.dates,
this.args.model.calendar.recurrenceRule
{
recurrenceRule: this.args.model.calendar.recurrenceRule,
location: this.args.model.calendar.location,
details: this.args.model.calendar.details,
}
);
}
this.args.closeModal();