mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-03 11:19:10 +08:00
feat: send initial servers state to main process on MCP servers change
This commit is contained in:
parent
9bd82a4e32
commit
ae98b5d3d9
@ -10,6 +10,10 @@ ipcRenderer.on('mcp:servers-changed', (_event, servers) => {
|
|||||||
store.dispatch(setMCPServers(servers))
|
store.dispatch(setMCPServers(servers))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Send initial servers state to main process
|
||||||
|
const initialServers = store.getState().mcp.servers
|
||||||
|
ipcRenderer.send('mcp:servers-from-renderer', initialServers)
|
||||||
|
|
||||||
export const useMCPServers = () => {
|
export const useMCPServers = () => {
|
||||||
const mcpServers = useAppSelector((state) => state.mcp.servers)
|
const mcpServers = useAppSelector((state) => state.mcp.servers)
|
||||||
const dispatch = useAppDispatch()
|
const dispatch = useAppDispatch()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user