修复错误警告

This commit is contained in:
xintaofei
2026-03-31 13:11:08 +08:00
parent 007b52c183
commit f2a53acc9d
8 changed files with 27 additions and 29 deletions

View File

@@ -21,10 +21,7 @@ import {
SelectValue,
} from "@/components/ui/select"
import { Switch } from "@/components/ui/switch"
import {
createChatChannel,
saveChatChannelToken,
} from "@/lib/api"
import { createChatChannel, saveChatChannelToken } from "@/lib/api"
import type { ChannelType } from "@/lib/types"
interface AddChatChannelDialogProps {
@@ -66,7 +63,7 @@ export function AddChatChannelDialog({
if (!nextOpen) resetForm()
onOpenChange(nextOpen)
},
[onOpenChange, resetForm],
[onOpenChange, resetForm]
)
const handleSubmit = useCallback(async () => {
@@ -151,9 +148,7 @@ export function AddChatChannelDialog({
</SelectTrigger>
<SelectContent>
<SelectItem value="telegram">Telegram</SelectItem>
<SelectItem value="lark">
{t("lark")}
</SelectItem>
<SelectItem value="lark">{t("lark")}</SelectItem>
</SelectContent>
</Select>
</div>
@@ -178,9 +173,7 @@ export function AddChatChannelDialog({
value={token}
onChange={(e) => setToken(e.target.value)}
placeholder={
channelType === "telegram"
? "123456:ABC-DEF..."
: "xxxxx"
channelType === "telegram" ? "123456:ABC-DEF..." : "xxxxx"
}
/>
</div>
@@ -197,9 +190,7 @@ export function AddChatChannelDialog({
</div>
<div className="flex items-center justify-between">
<label className="text-xs font-medium">
{t("dailyReport")}
</label>
<label className="text-xs font-medium">{t("dailyReport")}</label>
<Switch
checked={dailyReportEnabled}
onCheckedChange={setDailyReportEnabled}

View File

@@ -1358,20 +1358,18 @@ export async function deleteChatChannel(id: number): Promise<void> {
export async function saveChatChannelToken(
channelId: number,
token: string,
token: string
): Promise<void> {
return getTransport().call("save_chat_channel_token", { channelId, token })
}
export async function getChatChannelHasToken(
channelId: number,
channelId: number
): Promise<boolean> {
return getTransport().call("get_chat_channel_has_token", { channelId })
}
export async function deleteChatChannelToken(
channelId: number,
): Promise<void> {
export async function deleteChatChannelToken(channelId: number): Promise<void> {
return getTransport().call("delete_chat_channel_token", { channelId })
}
@@ -1416,7 +1414,7 @@ export async function getChatEventFilter(): Promise<string[] | null> {
}
export async function setChatEventFilter(
filter: string[] | null,
filter: string[] | null
): Promise<void> {
return getTransport().call("set_chat_event_filter", { filter })
}