代码提交/推送时,右侧边栏的提交列表实时更新最新状态

This commit is contained in:
xintaofei
2026-03-23 16:21:49 +08:00
parent b010ef071d
commit bf388526d7
2 changed files with 39 additions and 1 deletions

View File

@@ -1,7 +1,7 @@
"use client"
import { useState, useRef, useCallback, useMemo, useEffect } from "react"
import { listen, type UnlistenFn } from "@tauri-apps/api/event"
import { emit, listen, type UnlistenFn } from "@tauri-apps/api/event"
import {
GitBranch,
ChevronDown,
@@ -245,6 +245,9 @@ export function BranchDropdown({
const successDescription = getSuccessDescription?.(result)
updateTask(taskId, { status: "completed" })
onBranchChange()
void emit("folder://git-branch-changed", {
folder_id: folder?.id,
})
if (successDescription !== false) {
toast.success(
t("toasts.taskCompleted", { label }),