From 64f1cc5e4a67f242efe3dd06855e86ec492c8997 Mon Sep 17 00:00:00 2001 From: goat <16760685+goaaats@users.noreply.github.com> Date: Tue, 7 Sep 2021 17:28:00 +0200 Subject: [PATCH] fix: append youtube timestamp to embed url if provided by january --- src/components/common/messaging/embed/EmbedMedia.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/components/common/messaging/embed/EmbedMedia.tsx b/src/components/common/messaging/embed/EmbedMedia.tsx index 8ffbbc07..35665f46 100644 --- a/src/components/common/messaging/embed/EmbedMedia.tsx +++ b/src/components/common/messaging/embed/EmbedMedia.tsx @@ -18,15 +18,22 @@ export default function EmbedMedia({ embed, width, height }: Props) { const client = useClient(); switch (embed.special?.type) { - case "YouTube": + case "YouTube": { + let timestamp = ""; + + if (embed.special.timestamp) { + timestamp = `&start=${embed.special.timestamp}`; + } + return (