修复所有lint警告和错误

This commit is contained in:
xintaofei
2026-03-26 21:47:13 +08:00
parent 5e5c48338b
commit f61f9fb025
20 changed files with 138 additions and 93 deletions

View File

@@ -753,6 +753,7 @@ export function MessageInput({
const selected = await openFileDialog({
multiple: true,
directory: false,
defaultPath,
})
if (!selected) return
const picked = Array.isArray(selected) ? selected : [selected]

View File

@@ -5,7 +5,9 @@ const emitEvent = async (event: string, payload?: unknown) => {
try {
const { emit } = await import("@tauri-apps/api/event")
await emit(event, payload)
} catch { /* not in Tauri */ }
} catch {
/* not in Tauri */
}
}
import { openFileDialog, subscribe } from "@/lib/platform"
import {
@@ -332,9 +334,7 @@ export function BranchDropdown({
async function handleBrowseWorktreePath() {
const selected = await openFileDialog({ directory: true, multiple: false })
if (selected) {
setWorktreePath(
Array.isArray(selected) ? selected[0] : selected,
)
setWorktreePath(Array.isArray(selected) ? selected[0] : selected)
}
}

View File

@@ -52,10 +52,9 @@ export function FolderNameDropdown() {
async function handleOpenFolder() {
const selected = await openFileDialog({ directory: true, multiple: false })
if (selected) {
await openFolderWindow(
Array.isArray(selected) ? selected[0] : selected,
{ newWindow: true },
)
await openFolderWindow(Array.isArray(selected) ? selected[0] : selected, {
newWindow: true,
})
}
}

View File

@@ -5,7 +5,9 @@ async function emitEvent(event: string, payload?: unknown) {
try {
const { emit } = await import("@tauri-apps/api/event")
await emit(event, payload)
} catch { /* not in Tauri */ }
} catch {
/* not in Tauri */
}
}
import { Check, FileWarning, Loader2, X, CheckCheck } from "lucide-react"
import { useTranslations } from "next-intl"

View File

@@ -1,6 +1,11 @@
"use client"
import { useCallback, useEffect, type ComponentType, type ReactNode } from "react"
import {
useCallback,
useEffect,
type ComponentType,
type ReactNode,
} from "react"
import {
Bot,
BookOpenText,

View File

@@ -192,26 +192,18 @@ export function WebServiceSettings() {
isRunning ? "bg-green-500" : "bg-muted-foreground/30"
}`}
/>
<span className="text-sm">
{isRunning ? "运行中" : "已停止"}
</span>
<span className="text-sm">{isRunning ? "运行中" : "已停止"}</span>
<button
onClick={isRunning ? handleStop : handleStart}
disabled={loading}
className="inline-flex h-8 items-center rounded-md border border-input bg-background px-3 text-xs font-medium ring-offset-background transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"
>
{loading
? "处理中..."
: isRunning
? "停止"
: "启动"}
{loading ? "处理中..." : isRunning ? "停止" : "启动"}
</button>
</div>
</div>
{error && (
<p className="text-sm text-destructive">{error}</p>
)}
{error && <p className="text-sm text-destructive">{error}</p>}
{/* Connection info */}
{isRunning && (