MCPcopy
hub / github.com/anomalyco/opencode / refreshFromStore

Function refreshFromStore

packages/desktop/src/main/wsl/servers.ts:108–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 }
107
108 const refreshFromStore = () => {
109 const persisted = readServers()
110 const items: WslServerItem[] = persisted.map((config) => {
111 const existing = state.servers.find((item) => item.config.id === config.id)
112 return {
113 config,
114 runtime: existing?.runtime ?? { kind: "stopped" },
115 }
116 })
117 setState({ servers: items })
118 }
119
120 const setRuntime = (id: string, runtime: WslServerRuntime) => {
121 updateServer(id, (item) => ({ ...item, runtime }))

Callers 1

initializeFunction · 0.85

Calls 2

setStateFunction · 0.85
findMethod · 0.65

Tested by

no test coverage detected