Show warning after Continue Anyway (#239)

This commit is contained in:
Stephen B 2025-07-24 12:02:16 -04:00 • committed by GitHub
parent afefeb1ff6
commit 2ca0b86364
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -454,6 +454,7 @@ struct HeartbeatApp: App {
@State private var alert_title = ""
@State private var showTimeoutError = false
@State private var showLogs = false
@State private var showContinueWarning = false
@State private var timeoutTimer: Timer?
@StateObject private var mount = MountingProgress.shared
@StateObject private var dnsChecker = DNSChecker() // New DNS check state object
@ -615,7 +616,7 @@ struct HeartbeatApp: App {
primaryButtonText: "Continue Anyway",
secondaryButtonText: "View Logs",
onPrimaryButtonTap: {
isLoading2 = false
showContinueWarning = true
},
onSecondaryButtonTap: {
showLogs = true
@ -623,6 +624,22 @@ struct HeartbeatApp: App {
showSecondaryButton: true
)
}
if showContinueWarning {
CustomErrorView(
title: "Proceeding Without Connection",
message: "StikDebug will not function as expected if you choose to continue.",
onDismiss: {
showContinueWarning = false
},
showButton: true,
primaryButtonText: "I Understand",
onPrimaryButtonTap: {
showContinueWarning = false
isLoading2 = false
}
)
}
}
)
.sheet(isPresented: $showLogs, onDismiss: {