Networking rework: simplified API calls.

This commit is contained in:
Vicnet
2023-11-16 13:13:06 +01:00
parent 17678dea5f
commit 3563c23e29
14 changed files with 731 additions and 97 deletions

View File

@@ -109,3 +109,30 @@ enum RecipeImportError: UserAlert {
return [.OK]
}
}
enum RequestAlert: UserAlert {
case REQUEST_DELAYED,
REQUEST_DROPPED,
REQUEST_SUCCESS
var localizedDescription: LocalizedStringKey {
switch self {
case .REQUEST_DELAYED: return "Could not establish a connection to the server. The action will be retried upon reconnection."
case .REQUEST_DROPPED: return "Unable to complete action."
case .REQUEST_SUCCESS: return "Action completed."
}
}
var localizedTitle: LocalizedStringKey {
switch self {
case .REQUEST_DELAYED: return "Action delayed"
case .REQUEST_DROPPED: return "Error"
case .REQUEST_SUCCESS: return "Success"
}
}
var alertButtons: [AlertButton] {
return [.OK]
}
}