Make onSendMessage parameter not nullable

This commit is contained in:
Benoit Marty
2026-08-13 09:21:31 +02:00
parent fb82291f0a
commit 8c8d232eac
2 changed files with 3 additions and 2 deletions
@@ -218,10 +218,10 @@ fun TextComposer(
placeholder = placeholder, placeholder = placeholder,
placeholderColor = ElementTheme.colors.textSecondary, placeholderColor = ElementTheme.colors.textSecondary,
onTyping = onTyping, onTyping = onTyping,
onSendMessage = { if (canSendTextMessage) onSendMessage() },
onReceiveSuggestion = onReceiveSuggestion, onReceiveSuggestion = onReceiveSuggestion,
richTextEditorStyle = style, richTextEditorStyle = style,
onSelectRichContent = onSelectRichContent, onSelectRichContent = onSelectRichContent,
onSendMessage = { if (canSendTextMessage) onSendMessage() },
) )
} }
} }
@@ -51,10 +51,10 @@ fun MarkdownTextInput(
placeholder: String, placeholder: String,
placeholderColor: androidx.compose.ui.graphics.Color, placeholderColor: androidx.compose.ui.graphics.Color,
onTyping: (Boolean) -> Unit, onTyping: (Boolean) -> Unit,
onSendMessage: () -> Unit,
onReceiveSuggestion: (Suggestion?) -> Unit, onReceiveSuggestion: (Suggestion?) -> Unit,
richTextEditorStyle: RichTextEditorStyle, richTextEditorStyle: RichTextEditorStyle,
onSelectRichContent: ((Uri) -> Unit)?, onSelectRichContent: ((Uri) -> Unit)?,
onSendMessage: (() -> Unit)? = null,
) { ) {
// Copied from io.element.android.wysiwyg.internal.utils.UriContentListener // Copied from io.element.android.wysiwyg.internal.utils.UriContentListener
class ReceiveUriContentListener( class ReceiveUriContentListener(
@@ -217,6 +217,7 @@ internal fun MarkdownTextInputPreview() {
placeholder = "Placeholder", placeholder = "Placeholder",
placeholderColor = ElementTheme.colors.textSecondary, placeholderColor = ElementTheme.colors.textSecondary,
onTyping = {}, onTyping = {},
onSendMessage = {},
onReceiveSuggestion = {}, onReceiveSuggestion = {},
richTextEditorStyle = style, richTextEditorStyle = style,
onSelectRichContent = {}, onSelectRichContent = {},