From 7d0b3be8c2c30c7c1823995ac88cbf6bf54334a2 Mon Sep 17 00:00:00 2001 From: Fredrik Burmester Date: Sun, 1 Feb 2026 16:27:32 +0100 Subject: [PATCH] chore(tv): remove debug logs from back handler --- hooks/useTVBackHandler.ts | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/hooks/useTVBackHandler.ts b/hooks/useTVBackHandler.ts index 9c7b7c4e..dd5ca106 100644 --- a/hooks/useTVBackHandler.ts +++ b/hooks/useTVBackHandler.ts @@ -79,14 +79,12 @@ export function useTVBackHandler() { if (isOnHomeRoot) { // On home tab root - disable interception to allow app exit if (lastMenuKeyState.current !== false) { - console.log("[useTVBackHandler] On home root - enabling app exit"); TVEventControl.disableTVMenuKey(); lastMenuKeyState.current = false; } } else { // On other screens - enable interception to handle navigation if (lastMenuKeyState.current !== true) { - console.log("[useTVBackHandler] Not on home - intercepting menu key"); TVEventControl.enableTVMenuKey(); lastMenuKeyState.current = true; } @@ -98,33 +96,23 @@ export function useTVBackHandler() { if (!evt) return; if (evt.eventType === "menu" || evt.eventType === "back") { // If on home root, let the default behavior happen (app exit) - // This shouldn't fire since we disabled menu key interception if (isOnHomeRoot) { - console.log("[useTVBackHandler] On home root, allowing exit"); return; } - console.log("[useTVBackHandler] Menu pressed:", { - currentTab, - atTabRoot, - }); - - // If at tab root level (but not home) + // If at tab root level (but not home), navigate to home if (atTabRoot) { - console.log("[useTVBackHandler] At tab root, navigating to home"); router.navigate("/(auth)/(tabs)/(home)"); return; } // Not at tab root - go back in the stack if (navigation.canGoBack()) { - console.log("[useTVBackHandler] Going back in navigation stack"); navigation.goBack(); return; } // Fallback: navigate to home - console.log("[useTVBackHandler] Fallback: navigating to home"); router.navigate("/(auth)/(tabs)/(home)"); } }); @@ -167,9 +155,6 @@ export function useTVBackHandler() { */ export function enableTVMenuKeyInterception() { if (Platform.isTV && TVEventControl) { - console.log( - "[enableTVMenuKeyInterception] Enabling TV menu key interception", - ); TVEventControl.enableTVMenuKey(); } }