()
| 2 | import { Installation } from "@/installation" |
| 3 | |
| 4 | export async function upgrade() { |
| 5 | const method = await Installation.method() |
| 6 | const latest = await Installation.latest(method).catch(() => {}) |
| 7 | if (!latest) return |
| 8 | if (Installation.VERSION === latest) return |
| 9 | if (method === "unknown") return |
| 10 | |
| 11 | await Installation.upgrade(method, latest) |
| 12 | .then(() => Bus.publish(Installation.Event.Updated, { version: latest })) |
| 13 | .catch(() => {}) |
| 14 | } |