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

Method fetchInstalled

src/render/core/Module/Module.ts:157–186  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

155 }
156
157 fetchInstalled(): Promise<boolean> {
158 const appStore = AppStore()
159 return new Promise((resolve) => {
160 if (this.installedFetched) {
161 this._fetchInstalledResolves.forEach((f) => f(true))
162 this._fetchInstalledResolves.splice(0)
163 resolve(true)
164 return
165 }
166 if (this.fetchInstalleding) {
167 this._fetchInstalledResolves.push(resolve)
168 return
169 }
170 console.trace('fetchInstalled run: ', this.typeFlag)
171 this.fetchInstalleding = true
172 const setup = JSON.parse(JSON.stringify(appStore.config.setup))
173 IPC.send('app-fork:version', 'allInstalledVersions', [this.typeFlag], setup).then(
174 async (key: string, res: any) => {
175 IPC.off(key)
176 const versions: { [key in AppModuleEnum]: Array<SoftInstalled> } = res?.data ?? {}
177 if (Object.prototype.hasOwnProperty.call(versions, this.typeFlag)) {
178 await this.applyInstalledVersions(versions[this.typeFlag] ?? [])
179 }
180 this._fetchInstalledResolves.forEach((f) => f(true))
181 this._fetchInstalledResolves.splice(0)
182 resolve(true)
183 }
184 )
185 })
186 }
187
188 fetchBrew() {
189 if (this.brewFetching) {

Callers 15

watchShowHideMethod · 0.95
reFetchFunction · 0.80
onConfirmMethod · 0.80
resetDataFunction · 0.80
fetchDataFunction · 0.80
delVersionFunction · 0.80
installOrUninstallFunction · 0.80
installOrUninstallXTermFunction · 0.80
installOrUninstallXTermFunction · 0.80
startMariaDBFunction · 0.80
openSiteBaseServiceFunction · 0.80

Calls 7

resolveFunction · 0.85
pushMethod · 0.80
offMethod · 0.80
parseMethod · 0.45
thenMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected