mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Update the SDK (#3196)
* Update the SDK. * Fix API breaks on send failures and propagate the new type. * Handle new SDK ShieldState. * Set up the ClientBuilder's `cachePath` option. * Delete the cacheDirectory during logout/clearCache. * Add unit tests for RestorationToken decoding and SessionDirectories generation.
This commit is contained in:
@@ -150,7 +150,7 @@ private extension TimelineItemSendInfo {
|
||||
itemID = timelineItem.id
|
||||
localizedString = timelineItem.localizedSendInfo
|
||||
|
||||
status = if adjustedDeliveryStatus == .sendingFailed {
|
||||
status = if case .sendingFailed = adjustedDeliveryStatus {
|
||||
.sendingFailed
|
||||
} else if let authenticity = timelineItem.properties.encryptionAuthenticity {
|
||||
.encryptionAuthenticity(authenticity)
|
||||
|
||||
@@ -35,11 +35,13 @@ struct TimelineStyler<Content: View>: View {
|
||||
var body: some View {
|
||||
mainContent
|
||||
.onChange(of: timelineItem.properties.deliveryStatus) { newStatus in
|
||||
if newStatus == .sendingFailed {
|
||||
if case .sendingFailed = newStatus {
|
||||
guard task == nil else {
|
||||
return
|
||||
}
|
||||
task = Task {
|
||||
// Add a short delay so that an immediate failure when retrying
|
||||
// shows as sending for long enough to be visible to the user.
|
||||
try? await Task.sleep(for: .milliseconds(700))
|
||||
if !Task.isCancelled {
|
||||
adjustedDeliveryStatus = newStatus
|
||||
@@ -101,7 +103,7 @@ struct TimelineItemStyler_Previews: PreviewProvider, TestablePreview {
|
||||
|
||||
static let failed: TextRoomTimelineItem = {
|
||||
var result = base
|
||||
result.properties.deliveryStatus = .sendingFailed
|
||||
result.properties.deliveryStatus = .sendingFailed(.unknown)
|
||||
return result
|
||||
}()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user