mobile: fix multiple timers set on reset root state causing jank

This commit is contained in:
Ammar Ahmed
2025-10-20 12:40:20 +05:00
parent d5fefd2f10
commit 66498e12ce
2 changed files with 3 additions and 4 deletions

View File

@@ -38,9 +38,6 @@ export function hideAuth(context) {
context === "intro"
) {
Navigation.replace("FluidPanelsView");
setTimeout(() => {
Navigation.resetRootState();
}, 1000);
} else {
Navigation.goBack();
}

View File

@@ -258,12 +258,14 @@ export const RootNavigation = () => {
(state) => state.settings.introCompleted
);
const clearSelection = useSelectionStore((state) => state.clearSelection);
const resetTimer = React.useRef<NodeJS.Timeout>(undefined);
const onStateChange = React.useCallback(
(state: any) => {
if (useSelectionStore.getState().selectionMode) {
clearSelection();
}
setTimeout(() => {
clearTimeout(resetTimer.current);
resetTimer.current = setTimeout(() => {
Navigation.resetRootState(state);
}, 1000);
hideAllTooltips();