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 {
52
52
@Injected ( \. images) private var images
53
53
@Injected ( \. fonts) private var fonts
54
54
55
- @StateObject var assetLoader : PhotoAssetLoader
55
+ @ObservedObject var assetLoader : PhotoAssetLoader
56
56
57
57
@State private var assetURL : URL ?
58
58
@State private var compressing = false
@@ -66,7 +66,21 @@ public struct PhotoAttachmentCell: View {
66
66
private var assetType : AssetType {
67
67
asset. mediaType == . video ? . video : . image
68
68
}
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
+
70
84
public var body : some View {
71
85
ZStack {
72
86
if let image = assetLoader. loadedImages [ asset. localIdentifier] {
You can’t perform that action at this time.
0 commit comments