@@ -21,14 +21,14 @@ public class MessageComposerViewModel: ObservableObject {
2121 }
2222 }
2323 }
24-
24+
2525 @Published private( set) var imageAssets : PHFetchResult < PHAsset > ?
2626 @Published private( set) var addedAssets = [ AddedAsset] ( ) {
2727 didSet {
2828 checkPickerSelectionState ( )
2929 }
3030 }
31-
31+
3232 @Published var text = " " {
3333 didSet {
3434 if text != " " {
@@ -43,12 +43,13 @@ public class MessageComposerViewModel: ObservableObject {
4343 checkPickerSelectionState ( )
4444 }
4545 }
46+
4647 @Published var addedCustomAttachments = [ CustomAttachment] ( ) {
4748 didSet {
4849 checkPickerSelectionState ( )
4950 }
5051 }
51-
52+
5253 @Published var pickerTypeState : PickerTypeState = . expanded( . none) {
5354 didSet {
5455 switch pickerTypeState {
@@ -59,7 +60,7 @@ public class MessageComposerViewModel: ObservableObject {
5960 }
6061 }
6162 }
62-
63+
6364 @Published private( set) var overlayShown = false {
6465 didSet {
6566 if overlayShown == true {
@@ -93,7 +94,7 @@ public class MessageComposerViewModel: ObservableObject {
9394 }
9495
9596 attachments += addedCustomAttachments. map { attachment in
96- return attachment. content
97+ attachment. content
9798 }
9899
99100 channelController. createNewMessage (
@@ -119,9 +120,9 @@ public class MessageComposerViewModel: ObservableObject {
119120
120121 public var sendButtonEnabled : Bool {
121122 !addedAssets. isEmpty ||
122- !text. isEmpty ||
123- !addedFileURLs. isEmpty ||
124- !addedCustomAttachments. isEmpty
123+ !text. isEmpty ||
124+ !addedFileURLs. isEmpty ||
125+ !addedCustomAttachments. isEmpty
125126 }
126127
127128 public func change( pickerState: AttachmentPickerState ) {
@@ -195,7 +196,7 @@ public class MessageComposerViewModel: ObservableObject {
195196 return true
196197 }
197198 }
198-
199+
199200 return false
200201 }
201202
@@ -214,7 +215,7 @@ public class MessageComposerViewModel: ObservableObject {
214215 temp. append ( attachment)
215216 }
216217
217- self . addedCustomAttachments = temp
218+ addedCustomAttachments = temp
218219 }
219220
220221 func isCustomAttachmentSelected( _ attachment: CustomAttachment ) -> Bool {
@@ -302,7 +303,7 @@ public struct CustomAttachment: Identifiable, Equatable {
302303
303304 public static func == ( lhs: CustomAttachment , rhs: CustomAttachment ) -> Bool {
304305 lhs. id == rhs. id
305- }
306+ }
306307
307308 public let id : String
308309 public let content : AnyAttachmentPayload
@@ -311,5 +312,4 @@ public struct CustomAttachment: Identifiable, Equatable {
311312 self . id = id
312313 self . content = content
313314 }
314-
315315}
0 commit comments