Skip to content

Commit 62c62e2

Browse files
fix(mobile): stop Git sheet refresh loop
GitOverviewSheet refreshed Git status in an effect keyed on the whole useSelectedThreadGitActions result. Each refresh invalidated refs, the listRefs result re-rendered the hook with a new object, and the effect fired again, so an idle open sheet issued refreshStatus + listRefs about five times a second. useSelectedThreadGitActions already refreshes on mount and on thread/cwd changes, so the sheet effect is removed. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 6e13d8f commit 62c62e2

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

‎apps/mobile/src/features/threads/git/GitOverviewSheet.tsx‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
type StaticScreenProps,
1717
} from "@react-navigation/native";
1818
import { SymbolView } from "../../../components/AppSymbol";
19-
import { useCallback, useEffect, useMemo, useState } from "react";
19+
import { useCallback, useMemo, useState } from "react";
2020
import { Alert, Platform, Pressable, RefreshControl, ScrollView, View } from "react-native";
2121

2222
import { Screen, ScreenStack, ScreenStackHeaderConfig } from "react-native-screens";
@@ -116,10 +116,6 @@ export function GitOverviewSheet(props: GitOverviewSheetProps) {
116116
[busy, gitStatus.data, hasPrimaryRemote, menuItems],
117117
);
118118

119-
useEffect(() => {
120-
void gitActions.refreshSelectedThreadGitStatus({ quiet: true });
121-
}, [gitActions]);
122-
123119
const openExistingPr = useCallback(async () => {
124120
const prUrl = gitStatus.data?.pr?.state === "open" ? gitStatus.data.pr.url : null;
125121
if (!prUrl) {

0 commit comments

Comments
 (0)