MCPcopy
hub / github.com/xpf0000/FlyEnv / reFetch

Function reFetch

src/render/components/Ollama/models/local/setup.ts:13–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11}>({
12 fetching: false,
13 async reFetch() {
14 const brewStore = BrewStore()
15 await brewStore.module('ollama').fetchInstalled()
16 const appStore = AppStore()
17 const current = appStore.config.server?.ollama?.current
18 const service = brewStore
19 .module('ollama')
20 .installed.find((o) => o.path === current?.path && o.version === current?.version)
21 if (!service) {
22 return false
23 }
24 this.list.splice(0)
25 this.fetching = true
26 IPC.send('app-fork:ollama', 'allModel', JSON.parse(JSON.stringify(service))).then(
27 (key: string, res: any) => {
28 IPC.off(key)
29 const list = res?.data ?? []
30 this.list = reactive(list)
31 this.fetching = false
32 }
33 )
34 return true
35 },
36 list: []
37})
38

Callers

nothing calls this directly

Calls 5

fetchInstalledMethod · 0.80
offMethod · 0.80
thenMethod · 0.45
sendMethod · 0.45
parseMethod · 0.45

Tested by

no test coverage detected