mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Automatically try reloading failed images on network changes (#3170)
* Add the networkMonitor to the NSE and delete the old MockMediaLoader * Generate a MediaLoaderMock through AutoMockable and use it in the MediaProviderTests * Implement an ImageProvider mechanism that automatically tries reloading images when connectivity is established again and use it for LoadableImages * Merge the ImageProvider protocol back into the MediaProvider * Address PR review comments * Provide a default sdk client request configuration * Address tasks not automatically cancelling themselves when views get deallocated
This commit is contained in:
@@ -18,7 +18,7 @@ import SwiftUI
|
||||
|
||||
struct InviteUsersScreenSelectedItem: View {
|
||||
let user: UserProfileProxy
|
||||
let imageProvider: ImageProviderProtocol?
|
||||
let mediaProvider: MediaProviderProtocol?
|
||||
let dismissAction: () -> Void
|
||||
|
||||
var body: some View {
|
||||
@@ -39,7 +39,7 @@ struct InviteUsersScreenSelectedItem: View {
|
||||
name: user.displayName,
|
||||
contentID: user.userID,
|
||||
avatarSize: .user(on: .inviteUsers),
|
||||
imageProvider: imageProvider)
|
||||
mediaProvider: mediaProvider)
|
||||
.overlay(alignment: .topTrailing) {
|
||||
Button(action: dismissAction) {
|
||||
Image(systemName: "xmark.circle.fill")
|
||||
@@ -59,7 +59,7 @@ struct InviteUsersScreenSelectedItem_Previews: PreviewProvider, TestablePreview
|
||||
ScrollView(.horizontal) {
|
||||
HStack(spacing: 28) {
|
||||
ForEach(people, id: \.userID) { user in
|
||||
InviteUsersScreenSelectedItem(user: user, imageProvider: MockMediaProvider(), dismissAction: { })
|
||||
InviteUsersScreenSelectedItem(user: user, mediaProvider: MockMediaProvider(), dismissAction: { })
|
||||
.frame(width: 72)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user