[DisableIdleTimeout]: Fix: moved setting isIdleTimerDisabled = false to AppManager.finish()

This commit is contained in:
Magesh K
2025-02-02 04:18:36 +05:30
parent e43e962bcc
commit c3847276f7

View File

@@ -1235,9 +1235,10 @@ private extension AppManager
UIApplication.shared.isIdleTimerDisabled = UserDefaults.standard.isIdleTimeoutDisableEnabled UIApplication.shared.isIdleTimerDisabled = UserDefaults.standard.isIdleTimeoutDisableEnabled
} }
performAppOperations() performAppOperations()
DispatchQueue.main.schedule { // Moved to self.finish()
UIApplication.shared.isIdleTimerDisabled = false // DispatchQueue.main.schedule {
} // UIApplication.shared.isIdleTimerDisabled = false
// }
} }
return group return group
@@ -2098,6 +2099,11 @@ private extension AppManager
func finish(_ operation: AppOperation, result: Result<InstalledApp, Error>, group: RefreshGroup, progress: Progress?) func finish(_ operation: AppOperation, result: Result<InstalledApp, Error>, group: RefreshGroup, progress: Progress?)
{ {
// remove disableIdleTimeout
DispatchQueue.main.schedule {
UIApplication.shared.isIdleTimerDisabled = false
}
// Must remove before saving installedApp. // Must remove before saving installedApp.
if let currentProgress = self.progress(for: operation), currentProgress == progress if let currentProgress = self.progress(for: operation), currentProgress == progress
{ {