MCPcopy
hub / github.com/NitroRCr/AIaW / checkUpdate

Function checkUpdate

src/utils/update.ts:15–28  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13type Version = typeof version
14
15async function checkUpdate() {
16 if (IsWeb) return
17 if (DisableCheckUpdate) return
18 const res = await fetch(`${BaseURL}/version.json`)
19 if (!res.ok) return
20 const latest: Version = await res.json()
21 if (latest.versionCode <= version.versionCode) return
22 const force = version.versionCode <= latest.forceUpdateFrom
23 if (IsCapacitor) {
24 await capLiveUpdate(latest, force)
25 } else if (IsTauri) {
26 await tauriUpdate(latest, force)
27 }
28}
29
30function wrapNotify(message: string, actions: QNotifyAction[]) {
31 return Notify.create({

Callers

nothing calls this directly

Calls 3

fetchFunction · 0.85
capLiveUpdateFunction · 0.85
tauriUpdateFunction · 0.85

Tested by

no test coverage detected