Skip to content

Commit

Permalink
πŸ› (LekaApp): End update alert spamming
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Nov 29, 2024
1 parent cffa0d3 commit 58f9fa0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions Apps/LekaApp/Sources/Views/MainView/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,15 @@ struct MainView: View {
AnalyticsManager.logEventScreenView(screenName: "view_caregiver_picker")
}
.onDisappear {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
if case .appUpdateAvailable = UpdateManager.shared.appUpdateStatus {
self.showingAppUpdateAlert = true
} else if case .osUpdateAvailable = UpdateManager.shared.osUpdateStatus {
self.showingOSUpdateAlert = true
if !self.updateAlertHasBeenShown {
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
if case .appUpdateAvailable = UpdateManager.shared.appUpdateStatus {
self.showingAppUpdateAlert = true
self.updateAlertHasBeenShown = true
} else if case .osUpdateAvailable = UpdateManager.shared.osUpdateStatus {
self.showingOSUpdateAlert = true
self.updateAlertHasBeenShown = true
}
}
}
}
Expand Down Expand Up @@ -435,6 +439,7 @@ struct MainView: View {

@State private var showingAppUpdateAlert: Bool = false
@State private var showingOSUpdateAlert: Bool = false
@State private var updateAlertHasBeenShown: Bool = false

private var persistentDataManager: PersistentDataManager = .shared
private var caregiverManager: CaregiverManager = .shared
Expand Down

0 comments on commit 58f9fa0

Please sign in to comment.