fix(mobile): exiting from huddle

This commit is contained in:
Arjun Patel
2026-05-26 16:15:22 -07:00
parent 5b4643bcb3
commit d400057f7e
@@ -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