From 36e66c2d7cf46f0cdf5c78df0d8613882e5a57ff Mon Sep 17 00:00:00 2001 From: Rodrigo Arze Leon Date: Sun, 23 Feb 2025 08:34:34 -0400 Subject: [PATCH] Simplify theme update effect and minor fixes (#275) --- apps/connect-dev/app/page.tsx | 5 ++--- .../app/dashboard/(authenticated)/connect/page.tsx | 4 +--- apps/web/app/global.css | 5 +++++ .../engine-frontend/components/ConnectionPortal.tsx | 12 ++---------- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/apps/connect-dev/app/page.tsx b/apps/connect-dev/app/page.tsx index 6d2136be..cdde11b0 100644 --- a/apps/connect-dev/app/page.tsx +++ b/apps/connect-dev/app/page.tsx @@ -10,9 +10,8 @@ export default function Home() { baseUrl="http://localhost:4000" params={{ token: process.env['OPENINT_TOKEN'], - connectionId: 'conn_github_01JH6FR8H2E1G79HJVYEANYM7T', - view: 'manage-deeplink', - theme: 'light', + view: 'manage', + theme: 'dark', }} height={500} width={350} diff --git a/apps/web/app/dashboard/(authenticated)/connect/page.tsx b/apps/web/app/dashboard/(authenticated)/connect/page.tsx index 2ab5f4fb..aa98063b 100644 --- a/apps/web/app/dashboard/(authenticated)/connect/page.tsx +++ b/apps/web/app/dashboard/(authenticated)/connect/page.tsx @@ -147,9 +147,7 @@ export default function MagicLinkPage() { { - const themeParam = searchParams.get('theme') - // Only update if there's a valid theme parameter that differs from current theme if (themeParam && isValidTheme(themeParam) && themeParam !== theme) { setTheme(themeParam) - } else if (!themeParam && theme) { - // Only update URL if there's no theme parameter but we have a theme set - const params = new URLSearchParams(searchParams) - params.set('theme', theme) - router.replace(`${pathname}?${params.toString()}`, { - scroll: false, - }) } - }, [searchParams, setTheme, theme, pathname, router]) + }, [themeParam, setTheme, theme]) const deleteConnection = _trpcReact.deleteConnection.useMutation({ onSuccess: () => {