diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/src/main/java/com/wireguard/android/updater/Updater.kt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ui/src/main/java/com/wireguard/android/updater/Updater.kt b/ui/src/main/java/com/wireguard/android/updater/Updater.kt index f652ae2b..dbdbacfe 100644 --- a/ui/src/main/java/com/wireguard/android/updater/Updater.kt +++ b/ui/src/main/java/com/wireguard/android/updater/Updater.kt @@ -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() { |