fix(mobile): exiting from huddle
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { useCallback, useEffect, useState } from "react";
|
import { useCallback, useEffect, useState } from "react";
|
||||||
import { Alert, Dimensions, Pressable, Text, View } from "react-native";
|
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 { SafeAreaView, useSafeAreaInsets } from "react-native-safe-area-context";
|
||||||
import { StatusBar } from "expo-status-bar";
|
import { StatusBar } from "expo-status-bar";
|
||||||
import * as Haptics from "expo-haptics";
|
import * as Haptics from "expo-haptics";
|
||||||
@@ -385,7 +386,11 @@ function StreamViewInner({ streamParticle, path, onExit }: StreamViewProps) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// --- End-of-stream countdown ---
|
// --- 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) +
|
// Chrome reservations: top = safe-area + segmented bar (3) + gap (12) +
|
||||||
// metadata row (~38) + breathing room (12). Bottom = safe-area + compose
|
// metadata row (~38) + breathing room (12). Bottom = safe-area + compose
|
||||||
|
|||||||
Reference in New Issue
Block a user