修复右侧边栏“提交”区域在没有提交记录时显示错误
This commit is contained in:
@@ -13,6 +13,7 @@ import { revealItemInDir } from "@tauri-apps/plugin-opener"
|
||||
import ignore from "ignore"
|
||||
import { Check, ChevronRight } from "lucide-react"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { toErrorMessage } from "@/lib/app-error"
|
||||
import { toast } from "sonner"
|
||||
import { useFolderContext } from "@/contexts/folder-context"
|
||||
import { useAuxPanelContext } from "@/contexts/aux-panel-context"
|
||||
@@ -947,7 +948,7 @@ export function FileTreeTab() {
|
||||
setGitStatusByPath(new Map())
|
||||
}
|
||||
} catch (e) {
|
||||
setError(e instanceof Error ? e.message : String(e))
|
||||
setError(toErrorMessage(e))
|
||||
} finally {
|
||||
if (!silent && !loadingReleased) setLoading(false)
|
||||
}
|
||||
|
||||
@@ -83,6 +83,7 @@ import {
|
||||
} from "@/lib/tauri"
|
||||
import type { GitBranchList, GitLogEntry, GitLogFileChange } from "@/lib/types"
|
||||
import { toast } from "sonner"
|
||||
import { toErrorMessage } from "@/lib/app-error"
|
||||
|
||||
function formatRelativeTime(
|
||||
dateStr: string,
|
||||
@@ -684,7 +685,7 @@ export function GitLogTab() {
|
||||
} catch (e) {
|
||||
setBranchesError((prev) => ({
|
||||
...prev,
|
||||
[fullHash]: e instanceof Error ? e.message : String(e),
|
||||
[fullHash]: toErrorMessage(e),
|
||||
}))
|
||||
} finally {
|
||||
setBranchesLoading((prev) => ({ ...prev, [fullHash]: false }))
|
||||
@@ -727,7 +728,7 @@ export function GitLogTab() {
|
||||
)
|
||||
}
|
||||
} catch (e) {
|
||||
setError(e instanceof Error ? e.message : String(e))
|
||||
setError(toErrorMessage(e))
|
||||
} finally {
|
||||
if (inline) {
|
||||
setRefreshing(false)
|
||||
|
||||
Reference in New Issue
Block a user