File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed
Sources/StreamChatSwiftUI/ChatChannel/Composer Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ public struct PhotoAttachmentCell: View {
5252 @Injected ( \. images) private var images
5353 @Injected ( \. fonts) private var fonts
5454
55- @StateObject var assetLoader : PhotoAssetLoader
55+ @ObservedObject var assetLoader : PhotoAssetLoader
5656
5757 @State private var assetURL : URL ?
5858 @State private var compressing = false
@@ -66,7 +66,21 @@ public struct PhotoAttachmentCell: View {
6666 private var assetType : AssetType {
6767 asset. mediaType == . video ? . video : . image
6868 }
69-
69+
70+ public init (
71+ assetLoader: PhotoAssetLoader ,
72+ requestId: PHContentEditingInputRequestID ? = nil ,
73+ asset: PHAsset ,
74+ onImageTap: @escaping ( AddedAsset ) -> Void ,
75+ imageSelected: @escaping ( String ) -> Bool
76+ ) {
77+ _assetLoader = ObservedObject ( initialValue: assetLoader)
78+ self . requestId = requestId
79+ self . asset = asset
80+ self . onImageTap = onImageTap
81+ self . imageSelected = imageSelected
82+ }
83+
7084 public var body : some View {
7185 ZStack {
7286 if let image = assetLoader. loadedImages [ asset. localIdentifier] {
You can’t perform that action at this time.
0 commit comments