Skip to content

Commit

Permalink
Fixes broken avatar slug link in availability page : OG image (#3255)
Browse files Browse the repository at this point in the history
* fixed broken avatar slug link

* alternate fix

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 15, 2022
1 parent 0433b0a commit ff6a7bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion apps/web/components/booking/pages/AvailabilityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ const AvailabilityPage = ({ profile, eventType }: Props) => {
),
[timeZone]
);
const rawSlug = profile.slug ? profile.slug.split("/") : [];
if (rawSlug.length > 1) rawSlug.pop(); //team events have team name as slug, but user events have [user]/[type] as slug.
const slug = rawSlug.join("/");

return (
<>
Expand All @@ -374,7 +377,7 @@ const AvailabilityPage = ({ profile, eventType }: Props) => {
title={`${rescheduleUid ? t("reschedule") : ""} ${eventType.title} | ${profile.name}`}
description={`${rescheduleUid ? t("reschedule") : ""} ${eventType.title}`}
name={profile.name || undefined}
username={profile.slug || undefined}
username={slug || undefined}
/>
<CustomBranding lightVal={profile.brandColor} darkVal={profile.darkBrandColor} />
<div>
Expand Down

0 comments on commit ff6a7bf

Please sign in to comment.