diff --git a/components/party/PartyFooter/index.tsx b/components/party/PartyFooter/index.tsx index 5b05a218..8abcee11 100644 --- a/components/party/PartyFooter/index.tsx +++ b/components/party/PartyFooter/index.tsx @@ -59,38 +59,36 @@ const PartyFooter = (props: Props) => { useState() useEffect(() => { - // Extract the video IDs from the description if (partySnapshot.description) { - const videoIds = extractYoutubeVideoIds(partySnapshot.description) - - // Fetch the video titles for each ID - const fetchPromises = videoIds.map(({ id }) => fetchYoutubeData(id)) - - // Wait for all the video titles to be fetched - Promise.all(fetchPromises).then((videoTitles) => { - // Replace the video URLs in the description with LiteYoutubeEmbed elements - const newDescription = reactStringReplace( - partySnapshot.description, - youtubeUrlRegex, - (match, i) => ( - - ) - ) - - // Update the state with the new description - setEmbeddedDescription(newDescription) - }) + const purified = DOMPurify.sanitize(partySnapshot.description) + setSanitizedDescription(purified) } else { setEmbeddedDescription('') } }, [partySnapshot.description]) + // Extract the video IDs from the description + // const videoIds = extractYoutubeVideoIds(partySnapshot.description) + // Fetch the video titles for each ID + // const fetchPromises = videoIds.map(({ id }) => fetchYoutubeData(id)) + // // Wait for all the video titles to be fetched + // Promise.all(fetchPromises).then((videoTitles) => { + // // Replace the video URLs in the description with LiteYoutubeEmbed elements + // const newDescription = reactStringReplace( + // partySnapshot.description, + // youtubeUrlRegex, + // (match, i) => ( + // + // ) + // ) + // Update the state with the new description + async function fetchYoutubeData(videoId: string) { return await youtube .getVideoById(videoId, { maxResults: 1 })