From d400057f7eb23588b225a3fc8fd25a2ae789b193 Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Tue, 26 May 2026 16:15:22 -0700 Subject: [PATCH] fix(mobile): exiting from huddle --- js/mobile/src/features/stream-view/StreamView.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/js/mobile/src/features/stream-view/StreamView.tsx b/js/mobile/src/features/stream-view/StreamView.tsx index 348f2a1..c348478 100644 --- a/js/mobile/src/features/stream-view/StreamView.tsx +++ b/js/mobile/src/features/stream-view/StreamView.tsx @@ -1,5 +1,6 @@ import { useCallback, useEffect, useState } from "react"; import { Alert, Dimensions, Pressable, Text, View } from "react-native"; +import { useIsFocused } from "@react-navigation/native"; import { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context"; import { StatusBar } from "expo-status-bar"; import * as Haptics from "expo-haptics"; @@ -385,7 +386,11 @@ function StreamViewInner({ streamParticle, path, onExit }: StreamViewProps) { }); // --- End-of-stream countdown --- - const exitRemainingMs = useExitCountdown(status, paused, exit); + // Pause the countdown when this screen isn't focused (e.g. a Huddle screen + // is mounted on top). Otherwise the timer keeps ticking under the huddle + // and goBack() pops the huddle out from under the user. + const isFocused = useIsFocused(); + const exitRemainingMs = useExitCountdown(status, paused || !isFocused, exit); // Chrome reservations: top = safe-area + segmented bar (3) + gap (12) + // metadata row (~38) + breathing room (12). Bottom = safe-area + compose