mirror of
https://github.com/discourse/discourse.git
synced 2026-08-03 01:49:44 -05:00
FIX: add support for default title in localdates (#36511)
When clicking "Add to calendar" in chat we would error out cause title was null.
This commit is contained in:
@@ -5117,6 +5117,7 @@ en:
|
||||
add_to_calendar: "Add to calendar"
|
||||
google: "Google Calendar"
|
||||
ics: "ICS"
|
||||
default_title: "Scheduled Event"
|
||||
tagging:
|
||||
all_tags: "All tags"
|
||||
other_tags: "Other Tags"
|
||||
|
||||
@@ -2,12 +2,13 @@ import downloadCalendarModal from "discourse/components/modal/download-calendar"
|
||||
import { getOwnerWithFallback } from "discourse/lib/get-owner";
|
||||
import getURL from "discourse/lib/get-url";
|
||||
import User from "discourse/models/user";
|
||||
import { i18n } from "discourse-i18n";
|
||||
|
||||
export function downloadCalendar(title, dates, options = {}) {
|
||||
const currentUser = User.current();
|
||||
|
||||
const formattedDates = formatDates(dates);
|
||||
title = title.trim();
|
||||
title = (title || i18n("download_calendar.default_title")).trim();
|
||||
|
||||
switch (currentUser?.user_option.default_calendar) {
|
||||
case "ics":
|
||||
|
||||
Reference in New Issue
Block a user