mirror of
https://github.com/yattee/yattee.git
synced 2025-12-03 22:58:16 +00:00
Less obnoxious error handling
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import Foundation
|
||||
import Siesta
|
||||
import SwiftUI
|
||||
|
||||
final class NavigationModel: ObservableObject {
|
||||
@@ -257,6 +258,11 @@ final class NavigationModel: ObservableObject {
|
||||
presentingAlert = true
|
||||
}
|
||||
|
||||
func presentRequestErrorAlert(_ error: RequestError) {
|
||||
let errorDescription = String(format: "Verify you have stable connection with the server you are using (%@)", AccountsModel.shared.current.instance.longDescription)
|
||||
presentAlert(title: "Connection Error", message: "\(error.userMessage)\n\n\(errorDescription)")
|
||||
}
|
||||
|
||||
func presentAlert(_ alert: Alert) {
|
||||
self.alert = alert
|
||||
presentingAlert = true
|
||||
|
||||
Reference in New Issue
Block a user