From f8ac4895fa7def88d2e2905a8df57726f85aa048 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Wed, 3 Jun 2026 16:22:41 +0300 Subject: [PATCH] fix(connection): keep selected app when switching platform MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switching the platform dropdown always reset the app to the new platform's featured/first one, discarding the user's choice (e.g. picked Happ → switched platform → snapped back to the first app). Now it keeps the same app by name if it exists on the new platform, falling back to featured/first only otherwise. --- src/components/connection/InstallationGuide.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/connection/InstallationGuide.tsx b/src/components/connection/InstallationGuide.tsx index a6038a5..53c3092 100644 --- a/src/components/connection/InstallationGuide.tsx +++ b/src/components/connection/InstallationGuide.tsx @@ -266,7 +266,12 @@ export default function InstallationGuide({ setActivePlatformKey(newPlatform); const data = appConfig.platforms[newPlatform] as RemnawavePlatformData | undefined; if (data?.apps?.length) { - const app = data.apps.find((a) => a.featured) || data.apps[0]; + // Keep the user's current app (by name) if it also exists on the + // new platform; only fall back to featured/first otherwise. + const app = + data.apps.find((a) => a.name === selectedApp?.name) || + data.apps.find((a) => a.featured) || + data.apps[0]; if (app) setSelectedApp(app); } }}