Skip to content

Commit a4a1e1a

Browse files
authored
fix: prevent diff tab from closing on load (#366)
1 parent 322f15f commit a4a1e1a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

apps/array/src/renderer/features/code-editor/components/DiffEditorPanel.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function DiffEditorPanel({
3434
(s) => s.closeDiffTabsForFile,
3535
);
3636

37-
const { data: changedFiles = [] } = useQuery({
37+
const { data: changedFiles = [], isLoading: loadingChangelist } = useQuery({
3838
queryKey: ["changed-files-head", repoPath],
3939
queryFn: () =>
4040
trpcVanilla.git.getChangedFilesHead.query({
@@ -96,7 +96,9 @@ export function DiffEditorPanel({
9696
);
9797

9898
const isLoading =
99-
(!isDeleted && loadingModified) || (!isNew && loadingOriginal);
99+
loadingChangelist ||
100+
(!isDeleted && loadingModified) ||
101+
(!isNew && loadingOriginal);
100102

101103
const hasNoChanges =
102104
!!repoPath &&

0 commit comments

Comments
 (0)