Skip to content

Commit fafd5d4

Browse files
committed
Let invokeOnCurrentTimeline lambda param return Unit so that we can remove run block.
1 parent a3e2457 commit fafd5d4

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/messagecomposer/MessageComposerPresenter.kt

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -592,13 +592,11 @@ class MessageComposerPresenter @Inject constructor(
592592
)
593593
timelineController.invokeOnCurrentTimeline {
594594
val replyToDetails = loadReplyDetails(draftType.eventId).map(permalinkParser)
595-
run {
596-
messageComposerContext.composerMode = MessageComposerMode.Reply(
597-
replyToDetails = replyToDetails,
598-
// I guess it's fine to always render the image when restoring a draft
599-
hideImage = false
600-
)
601-
}
595+
messageComposerContext.composerMode = MessageComposerMode.Reply(
596+
replyToDetails = replyToDetails,
597+
// I guess it's fine to always render the image when restoring a draft
598+
hideImage = false
599+
)
602600
}
603601
}
604602
}

features/messages/impl/src/main/kotlin/io/element/android/features/messages/impl/timeline/TimelineController.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class TimelineController @Inject constructor(
5757
return detachedTimeline.map { !it.isPresent }
5858
}
5959

60-
suspend fun invokeOnCurrentTimeline(block: suspend (Timeline.() -> Any)) {
60+
suspend fun invokeOnCurrentTimeline(block: suspend (Timeline.() -> Unit)) {
6161
currentTimelineFlow.value.run {
6262
block(this)
6363
}

0 commit comments

Comments
 (0)