Skip to content

Commit

Permalink
🚸 (LekaUpdater): Disable turning screen off during update
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli committed Nov 20, 2023
1 parent 8b0ac08 commit 161285d
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Apps/LekaUpdater/Resources/ll10n/Localizable.xcstrings
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
{
"sourceLanguage" : "en",
"strings" : {
" - (LekaOS v%@)" : {

},
"%" : {

},
"%@" : {

},
"%@/3" : {

},
"1/3" : {

},
"2/3" : {

},
"3/3" : {

},
"connection.connect_button" : {
"comment" : "Connect button",
"extractionState" : "extracted_with_value",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import Combine
import Foundation
import LocalizationKit
import SwiftUI

class UpdateStatusViewModel: ObservableObject {

Expand Down Expand Up @@ -88,6 +89,7 @@ class UpdateStatusViewModel: ObservableObject {
self.errorDescription = String(l10n.update.error.unknownErrorDescription.characters)
self.errorInstructions = String(l10n.update.error.unknownErrorInstructions.characters)
}
self.onUpdateEnded()
}
} receiveValue: { state in
switch state {
Expand Down Expand Up @@ -122,7 +124,13 @@ class UpdateStatusViewModel: ObservableObject {
}

public func startUpdate() {
UIApplication.shared.isIdleTimerDisabled = true

updateProcessController.startUpdate()
}

private func onUpdateEnded() {
UIApplication.shared.isIdleTimerDisabled = false
}

}

0 comments on commit 161285d

Please sign in to comment.