mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Offer Retry and Remove actions with a reason when tapping a failed message
Tapping the red (!) on a message that failed to send used to show a bare "Sending failed" alert with only an OK button. Now the alert includes the failure reason from the SDK (e.g. the HTTP error that caused it) and offers Retry sending, Remove message and Cancel actions, wired to the send handle's resend and to redacting the local echo respectively.
This commit is contained in:
committed by
Stefan Ceriu
parent
033cb2e038
commit
1aa9b29eb5
@@ -65,7 +65,7 @@ nonisolated enum TimelineItemSendFailure: Hashable {
|
||||
}
|
||||
|
||||
case verifiedUser(VerifiedUser)
|
||||
case unknown
|
||||
case unknown(reason: String?)
|
||||
}
|
||||
|
||||
/// A light wrapper around event timeline items returned from Rust.
|
||||
@@ -95,8 +95,10 @@ final nonisolated class EventTimelineItemProxy: Sendable {
|
||||
return .sendingFailed(.verifiedUser(.changedIdentity(users: users)))
|
||||
case .insecureDevices(let userDeviceMap):
|
||||
return .sendingFailed(.verifiedUser(.hasUnsignedDevice(devices: userDeviceMap)))
|
||||
case .genericApiError(let message):
|
||||
return .sendingFailed(.unknown(reason: message))
|
||||
default:
|
||||
return .sendingFailed(.unknown)
|
||||
return .sendingFailed(.unknown(reason: nil))
|
||||
}
|
||||
case .notSentYet:
|
||||
return .sending
|
||||
|
||||
Reference in New Issue
Block a user