mirror of
https://github.com/modrinth/code.git
synced 2026-08-28 02:24:56 +00:00
fix: app restarting after the user closes when there's a pending update (#6074)
* fix: app restarting after the user closes when there's a pending update * add logging and fix tauri variable * use state * use atomicbool
This commit is contained in:
@@ -109,6 +109,7 @@ import {
|
||||
getUpdateSize,
|
||||
isDev,
|
||||
isNetworkMetered,
|
||||
setRestartAfterPendingUpdate,
|
||||
} from '@/helpers/utils.js'
|
||||
import i18n from '@/i18n.config'
|
||||
import { createContentInstall, provideContentInstall } from '@/providers/content-install'
|
||||
@@ -1025,6 +1026,13 @@ async function downloadUpdate(versionToDownload) {
|
||||
|
||||
async function installUpdate() {
|
||||
restarting.value = true
|
||||
try {
|
||||
await setRestartAfterPendingUpdate(true)
|
||||
} catch (e) {
|
||||
restarting.value = false
|
||||
handleError(e)
|
||||
return
|
||||
}
|
||||
setTimeout(async () => {
|
||||
await handleClose()
|
||||
}, 250)
|
||||
|
||||
Reference in New Issue
Block a user