Skip to content

Commit 803db4d

Browse files
Improved loading of gallery images
1 parent ea7c2d0 commit 803db4d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
33

44
# Upcoming
55

6-
### 🔄 Changed
6+
### 🐞 Fixed
7+
- Improved loading of gallery images
78

89
# [4.46.0](https://github.com/GetStream/stream-chat-swiftui/releases/tag/4.46.0)
910
_December 21, 2023_

Sources/StreamChatSwiftUI/ChatChannel/Composer/PhotoAssetsUtils.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class PhotoAssetLoader: NSObject, ObservableObject {
2121

2222
let options = PHImageRequestOptions()
2323
options.version = .current
24-
options.deliveryMode = .opportunistic
24+
options.deliveryMode = .highQualityFormat
2525

2626
PHImageManager.default().requestImage(
2727
for: asset,

Sources/StreamChatSwiftUI/ChatChannel/Composer/PhotoAttachmentPickerView.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ public struct PhotoAttachmentCell: View {
138138
}
139139
)
140140
.onAppear {
141+
self.loading = false
142+
141143
assetLoader.loadImage(from: asset)
142144

143145
if self.assetURL != nil {
@@ -170,6 +172,7 @@ public struct PhotoAttachmentCell: View {
170172
if let requestId = requestId {
171173
asset.cancelContentEditingInputRequest(requestId)
172174
self.requestId = nil
175+
loading = false
173176
}
174177
}
175178
}

0 commit comments

Comments
 (0)