diff --git a/frontend/src/components/PostEmbed.tsx b/frontend/src/components/PostEmbed.tsx index d5e7cba..70d596b 100644 --- a/frontend/src/components/PostEmbed.tsx +++ b/frontend/src/components/PostEmbed.tsx @@ -21,23 +21,30 @@ export default (({ post }: Props) => { const mVideoId = url.pathname.match (/(?<=\/watch\/)[a-zA-Z0-9]+?(?=\/|$)/) if (!(mVideoId)) break + const [videoId] = mVideoId + return } case 'twitter.com': case 'x.com': - const mUserId = url.pathname.match (/(?<=\/)[^\/]+?(?=\/|$|\?)/) - const mStatusId = url.pathname.match (/(?<=\/status\/)\d+?(?=\/|$|\?)/) - if (!(mUserId) || !(mStatusId)) - break - const [userId] = mUserId - const [statusId] = mStatusId - return + { + const mUserId = url.pathname.match (/(?<=\/)[^\/]+?(?=\/|$|\?)/) + const mStatusId = url.pathname.match (/(?<=\/status\/)\d+?(?=\/|$|\?)/) + if (!(mUserId) || !(mStatusId)) + break + + const [userId] = mUserId + const [statusId] = mStatusId + + return + } case 'youtube.com': { const videoId = url.searchParams.get ('v') if (!(videoId)) break + return (