()
| 447 | } |
| 448 | |
| 449 | export function clientUpdate() { |
| 450 | // this a wild for updating client app |
| 451 | return window.__TAURI__?.updater |
| 452 | .checkUpdate() |
| 453 | .then((updateResult) => { |
| 454 | if (updateResult.shouldUpdate) { |
| 455 | window.__TAURI__?.updater |
| 456 | .installUpdate() |
| 457 | .then((result) => { |
| 458 | showToast(Locale.Settings.Update.Success); |
| 459 | }) |
| 460 | .catch((e) => { |
| 461 | console.error("[Install Update Error]", e); |
| 462 | showToast(Locale.Settings.Update.Failed); |
| 463 | }); |
| 464 | } |
| 465 | }) |
| 466 | .catch((e) => { |
| 467 | console.error("[Check Update Error]", e); |
| 468 | showToast(Locale.Settings.Update.Failed); |
| 469 | }); |
| 470 | } |
| 471 | |
| 472 | // https://gist.github.com/iwill/a83038623ba4fef6abb9efca87ae9ccb |
| 473 | export function semverCompare(a: string, b: string) { |
no test coverage detected