Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 (LekaApp): End update alert spamming #1618

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -293,11 +293,15 @@
.logEventScreenView(screenName: "caregiver_picker", context: .sheet)
.navigationBarTitleDisplayMode(.inline)
.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 @@ -392,6 +396,7 @@

@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 All @@ -402,4 +407,4 @@

#Preview {
MainView()
}

Check warning on line 410 in Apps/LekaApp/Sources/Views/MainView/MainView.swift

View workflow job for this annotation

GitHub Actions / swiftlint

File should contain 400 lines or less: currently contains 410 (file_length)
Loading