From ca54cb4732ee30cc18a851cd8a6b8b2301194014 Mon Sep 17 00:00:00 2001 From: c0mrade Date: Wed, 3 Jun 2026 15:54:54 +0300 Subject: [PATCH] fix(connection): restrict Happ TV quick-connect to Android TV only Verified against Happ docs: the sendtv 5-digit-code / Web-Import API (check.happ.su/sendtv) is Android-TV-only. Apple TV (tvOS) uses a different mechanism (tv.happ.su temporary code), so POSTing the code to check.happ.su would hit the wrong endpoint. The block was gated on isTvPlatform (androidTV || appleTV); narrow it to androidTV. Apple TV now renders its normal config blocks. --- src/components/connection/InstallationGuide.tsx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/connection/InstallationGuide.tsx b/src/components/connection/InstallationGuide.tsx index c04b574..49dff9b 100644 --- a/src/components/connection/InstallationGuide.tsx +++ b/src/components/connection/InstallationGuide.tsx @@ -149,11 +149,12 @@ export default function InstallationGuide({ ], ); - const selectedIsTv = - (activePlatformKey || availablePlatforms[0]) === 'androidTV' || - (activePlatformKey || availablePlatforms[0]) === 'appleTV'; const userIsOnTv = detectedPlatform === 'androidTV' || detectedPlatform === 'appleTV'; - const isTvPlatform = selectedIsTv && !userIsOnTv; + // Happ's TV quick-connect (check.happ.su/sendtv, 5-digit code) is an ANDROID TV + // -only API. Apple TV uses a different mechanism (tv.happ.su temporary code), so + // the block must NOT show there — it would POST to the wrong endpoint. + const isAndroidTvLayout = + (activePlatformKey || availablePlatforms[0]) === 'androidTV' && !userIsOnTv; const currentPlatformKey = activePlatformKey || availablePlatforms[0]; const currentPlatformData = currentPlatformKey @@ -322,7 +323,7 @@ export default function InstallationGuide({ {/* Blocks — for the Happ TV app: first block, Quick Connect, last block. Other apps (or non-TV) render their blocks normally. */} - {selectedApp && isTvPlatform && isHappApp(selectedApp) && appConfig.subscriptionUrl ? ( + {selectedApp && isAndroidTvLayout && isHappApp(selectedApp) && appConfig.subscriptionUrl ? ( <> {selectedApp.blocks.length > 0 && (