From 3b405dc7d5e028462728b695bce7ee6e1b9b20d7 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Wed, 26 Jun 2024 11:20:53 +0200 Subject: [PATCH] :ambulance: Fix youtube URL detection regex --- .../features/blocks/bubbles/video/constants.ts | 2 +- packages/scripts/helpers/destroyUser.ts | 16 ++++------------ 2 files changed, 5 insertions(+), 13 deletions(-) diff --git a/packages/schemas/features/blocks/bubbles/video/constants.ts b/packages/schemas/features/blocks/bubbles/video/constants.ts index 26c58e704..2aa04df53 100644 --- a/packages/schemas/features/blocks/bubbles/video/constants.ts +++ b/packages/schemas/features/blocks/bubbles/video/constants.ts @@ -31,7 +31,7 @@ export const verticalVideoSuggestionSize = { const youtubeBaseUrl = 'https://www.youtube.com/embed' export const youtubeRegex = - /youtube\.com\/(watch\?v=|shorts\/)([\w-]+)|youtu\.be\/([\w-]+)(\?.+)/ + /youtube\.com\/(watch\?v=|shorts\/)([\w-]+)|youtu\.be\/([\w-]+)(\?.+)*/ export const youtubeEmbedParamsMap = { t: 'start', diff --git a/packages/scripts/helpers/destroyUser.ts b/packages/scripts/helpers/destroyUser.ts index 7665ebe57..20ac139a2 100644 --- a/packages/scripts/helpers/destroyUser.ts +++ b/packages/scripts/helpers/destroyUser.ts @@ -34,17 +34,6 @@ export const destroyUser = async (userEmail?: string) => { console.log(`Found ${workspaces.length} workspaces`) - if (workspaces.some((w) => w.plan !== Plan.FREE)) { - console.log( - `Some workspaces have a plan other than FREE. Something is wrong. Logging and exiting...` - ) - writeFileSync( - 'logs/workspaces-issue.json', - JSON.stringify(workspaces, null, 2) - ) - return - } - if ( workspaces.some((w) => w.members.some((m) => m.user.email && m.user.email !== email) @@ -60,7 +49,10 @@ export const destroyUser = async (userEmail?: string) => { return } - console.log('All workspaces have a FREE plan') + console.log( + 'Workspaces plans:', + workspaces.map((w) => w.plan) + ) const proceed = await confirm({ message: 'Proceed?' }) if (!proceed || typeof proceed !== 'boolean') {