public fun addSelectedAttachments(attachments: List<Attachment>) { val newAttachments = (selectedAttachments.value + attachments).distinctBy { if (it.name != null) { it.name } else { it } } selectedAttachments.value = newAttachments  handleValidationErrors() }
Stores the selected attachments from the attachment picker. These will be shown in the UI, within the composer component. We upload and send these attachments once the user taps on the send button.