Remove default value and clarify the code

This commit is contained in:
Benoit Marty 2024-11-21 09:55:43 +01:00
parent 8bcc9203ad
commit b387eac448

View file

@ -589,7 +589,8 @@ internal fun TextComposerEditCaptionPreview() = ElementPreview {
state = textEditorState, state = textEditorState,
voiceMessageState = VoiceMessageState.Idle, voiceMessageState = VoiceMessageState.Idle,
composerMode = aMessageComposerModeEditCaption( composerMode = aMessageComposerModeEditCaption(
content = "A caption", // Set an existing caption so that the UI will be in edit caption mode
content = "An existing caption",
), ),
enableVoiceMessages = false, enableVoiceMessages = false,
) )
@ -606,6 +607,7 @@ internal fun TextComposerAddCaptionPreview() = ElementPreview {
state = textEditorState, state = textEditorState,
voiceMessageState = VoiceMessageState.Idle, voiceMessageState = VoiceMessageState.Idle,
composerMode = aMessageComposerModeEditCaption( composerMode = aMessageComposerModeEditCaption(
// No caption so that the UI will be in add caption mode
content = "", content = "",
), ),
enableVoiceMessages = false, enableVoiceMessages = false,
@ -759,7 +761,7 @@ fun aMessageComposerModeEdit(
fun aMessageComposerModeEditCaption( fun aMessageComposerModeEditCaption(
eventOrTransactionId: EventOrTransactionId = EventId("$1234").toEventOrTransactionId(), eventOrTransactionId: EventOrTransactionId = EventId("$1234").toEventOrTransactionId(),
content: String = "Some caption", content: String,
) = MessageComposerMode.EditCaption( ) = MessageComposerMode.EditCaption(
eventOrTransactionId = eventOrTransactionId, eventOrTransactionId = eventOrTransactionId,
content = content content = content