fix(vcs): Skip the Git Log diff preview when it cannot open

Цей коміт міститься в:
l0ng-ai committed 2026-10-29 09:13:21 +08:00
1 джерело f1ff2731f0
коміт cfc916bfdb
1 file changed
+3 -1
+3 -1
Переглянути файл
@@ -1123,7 +1123,9 @@ export function CommitDetails({ commits }: { commits: Commit[] }) {
clearTimeout(previewTimer.current);
if (!logOptions().diffPreview || sel.size !== 1) return;
const file = fileNodeAt(tree, [...sel][0]!)?.file;
if (file) previewTimer.current = setTimeout(() => void showChangesDiff([file], true), PREVIEW_DELAY);
// A preview that cannot open (no editor yet, the file went away) is just skipped.
if (file)
previewTimer.current = setTimeout(() => void showChangesDiff([file], true).catch(() => undefined), PREVIEW_DELAY);
};
useEffect(() => {