fix(app): refresh directory MCP status (#31194)

This commit is contained in:
Luke Parker 2026-06-07 15:53:23 +10:00 committed by GitHub
commit a29deb1ee9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 101 additions and 58 deletions

View file

@ -0,0 +1,19 @@
import { useMutation } from "@tanstack/solid-query"
import { useLanguage } from "@/context/language"
import { useSync } from "@/context/sync"
import { showToast } from "@/utils/toast"
export function useMcpToggle() {
const sync = useSync()
const language = useLanguage()
return useMutation(() => ({
mutationFn: sync.mcp.toggle,
onError: (error) =>
showToast({
variant: "error",
title: language.t("common.requestFailed"),
description: error instanceof Error ? error.message : String(error),
}),
}))
}