(latest: Version, force: boolean)
| 76 | } |
| 77 | |
| 78 | async function tauriUpdate(latest: Version, force: boolean) { |
| 79 | const isDeb = TauriPlatform === 'linux' && await invoke('is_deb_package') |
| 80 | const update = await check(isDeb ? { target: 'linux-deb' } : {}) |
| 81 | if (!update) return |
| 82 | if (TauriPlatform === 'windows' || isDeb) { |
| 83 | if (force && !isUpdateIgnored(latest.version)) { |
| 84 | await update.download() |
| 85 | wrapNotify( |
| 86 | t('update.downloadedNewVersion', { version: latest.version }), |
| 87 | [{ |
| 88 | label: t('update.ignore'), |
| 89 | handler: () => { |
| 90 | ignoreUpdate(latest.version) |
| 91 | } |
| 92 | }, { |
| 93 | label: t('update.install'), |
| 94 | handler: async () => { |
| 95 | await update.install() |
| 96 | await relaunch() |
| 97 | } |
| 98 | }] |
| 99 | ) |
| 100 | } |
| 101 | } else { |
| 102 | await update.downloadAndInstall() |
| 103 | force && wrapNotify( |
| 104 | t('update.installedNewVersion', { version: latest.version }), |
| 105 | [{ |
| 106 | label: t('update.relaunch'), |
| 107 | handler: () => { |
| 108 | relaunch() |
| 109 | } |
| 110 | }] |
| 111 | ) |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | async function ready() { |
| 116 | IsCapacitor && await LiveUpdate.ready() |
no test coverage detected