Hotfix: Event Name (#6863) (#6864)

This commit is contained in:
Hariom Balhara authored and GitHub committed 2023-02-03 11:20:10 +01:00
1 parent 832fce91e0
commit 9093909075
2 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -240,7 +240,7 @@ export default function Success(props: SuccessProps) {
const giphyAppData = getEventTypeAppData(eventType, "giphy");
const giphyImage = giphyAppData?.thankYouPage;
const eventName = getEventName(eventNameObject);
const eventName = getEventName(eventNameObject, true);
const needsConfirmation = eventType.requiresConfirmation && reschedule != true;
const isCancelled = status === "CANCELLED" || status === "REJECTED";
const telemetry = useTelemetry();
+7 -2
View File
@@ -11,7 +11,7 @@ export type EventNameObjectType = {
t: TFunction;
};
export function getEventName(eventNameObj: EventNameObjectType) {
export function getEventName(eventNameObj: EventNameObjectType, forAttendeeView = false) {
if (!eventNameObj.eventName)
return eventNameObj.t("event_between_users", {
eventName: eventNameObj.eventType,
@@ -22,12 +22,13 @@ export function getEventName(eventNameObj: EventNameObjectType) {
let eventName = eventNameObj.eventName;
let locationString = eventNameObj.location || "";
if (eventNameObj.eventName.includes("{Location}")) {
if (eventNameObj.eventName.includes("{Location}") || eventNameObj.eventName.includes("{LOCATION}")) {
const eventLocationType = guessEventLocationType(eventNameObj.location);
if (eventLocationType) {
locationString = eventLocationType.label;
}
eventName = eventName.replace("{Location}", locationString);
eventName = eventName.replace("{LOCATION}", locationString);
}
return (
@@ -36,5 +37,9 @@ export function getEventName(eventNameObj: EventNameObjectType) {
.replace("{Event type title}", eventNameObj.eventType)
.replace("{Scheduler}", eventNameObj.attendeeName)
.replace("{Organiser}", eventNameObj.host)
.replace("{USER}", eventNameObj.attendeeName)
.replace("{ATTENDEE}", eventNameObj.attendeeName)
.replace("{HOST}", eventNameObj.host)
.replace("{HOST/ATTENDEE}", forAttendeeView ? eventNameObj.host : eventNameObj.attendeeName)
);
}