()
| 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 |
nothing calls this directly
no test coverage detected