ui: add basic double update guard
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
d883802178
commit
f2d166a6a4
@ -312,13 +312,18 @@ object Updater {
|
||||
session.close()
|
||||
}
|
||||
|
||||
private var updating = false
|
||||
private suspend fun downloadAndUpdateWrapErrors() {
|
||||
if (updating)
|
||||
return
|
||||
updating = true
|
||||
try {
|
||||
downloadAndUpdate()
|
||||
} catch (e: Throwable) {
|
||||
Log.e(TAG, "Update failure", e)
|
||||
emitProgress(Progress.Failure(e))
|
||||
}
|
||||
updating = false
|
||||
}
|
||||
|
||||
private class InstallReceiver : BroadcastReceiver() {
|
||||
|
Loading…
Reference in New Issue
Block a user