Rename handleEvents to handleEvent
This commit is contained in:
parent
6acd0ed687
commit
7ad9c8f687
94 changed files with 182 additions and 182 deletions
|
|
@ -221,7 +221,7 @@ class MessagesPresenter(
|
|||
onPauseOrDispose {}
|
||||
}
|
||||
|
||||
fun handleEvents(event: MessagesEvents) {
|
||||
fun handleEvent(event: MessagesEvents) {
|
||||
when (event) {
|
||||
is MessagesEvents.HandleAction -> {
|
||||
localCoroutineScope.handleTimelineAction(
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ class DefaultActionListPresenter(
|
|||
|
||||
val isThreadsEnabled = featureFlagService.isFeatureEnabledFlow(FeatureFlags.Threads).collectAsState(false)
|
||||
|
||||
fun handleEvents(event: ActionListEvents) {
|
||||
fun handleEvent(event: ActionListEvents) {
|
||||
when (event) {
|
||||
ActionListEvents.Clear -> target.value = ActionListState.Target.None
|
||||
is ActionListEvents.ComputeForMessage -> localCoroutineScope.computeForMessage(
|
||||
|
|
@ -122,7 +122,7 @@ class DefaultActionListPresenter(
|
|||
|
||||
return ActionListState(
|
||||
target = target.value,
|
||||
eventSink = ::handleEvents,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class AttachmentsPreviewPresenter(
|
|||
}
|
||||
}
|
||||
|
||||
fun handleEvents(attachmentsPreviewEvents: AttachmentsPreviewEvents) {
|
||||
fun handleEvent(attachmentsPreviewEvents: AttachmentsPreviewEvents) {
|
||||
when (attachmentsPreviewEvents) {
|
||||
is AttachmentsPreviewEvents.SendAttachment -> {
|
||||
ongoingSendAttachmentJob.value = coroutineScope.launch {
|
||||
|
|
@ -230,7 +230,7 @@ class AttachmentsPreviewPresenter(
|
|||
textEditorState = textEditorState,
|
||||
mediaOptimizationSelectorState = mediaOptimizationSelectorState,
|
||||
displayFileTooLargeError = displayFileTooLargeError,
|
||||
eventSink = ::handleEvents
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class ResolveVerifiedUserSendFailurePresenter(
|
|||
}
|
||||
val coroutineScope = rememberCoroutineScope()
|
||||
|
||||
fun handleEvents(event: ResolveVerifiedUserSendFailureEvents) {
|
||||
fun handleEvent(event: ResolveVerifiedUserSendFailureEvents) {
|
||||
when (event) {
|
||||
is ResolveVerifiedUserSendFailureEvents.ComputeForMessage -> {
|
||||
val sendState = event.messageEvent.localSendState as? LocalEventSendState.Failed.VerifiedUser
|
||||
|
|
@ -92,7 +92,7 @@ class ResolveVerifiedUserSendFailurePresenter(
|
|||
verifiedUserSendFailure = verifiedUserSendFailure,
|
||||
resolveAction = resolveAction.value,
|
||||
retryAction = retryAction.value,
|
||||
eventSink = ::handleEvents
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class LinkPresenter(
|
|||
override fun present(): LinkState {
|
||||
val linkClick: MutableState<AsyncAction<Link>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||
|
||||
fun handleEvents(linkEvents: LinkEvents) {
|
||||
fun handleEvent(linkEvents: LinkEvents) {
|
||||
when (linkEvents) {
|
||||
is LinkEvents.OnLinkClick -> {
|
||||
linkClick.value = AsyncAction.Loading
|
||||
|
|
@ -48,7 +48,7 @@ class LinkPresenter(
|
|||
}
|
||||
return LinkState(
|
||||
linkClick = linkClick.value,
|
||||
eventSink = ::handleEvents,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -227,7 +227,7 @@ class MessageComposerPresenter(
|
|||
}
|
||||
}
|
||||
|
||||
fun handleEvents(event: MessageComposerEvents) {
|
||||
fun handleEvent(event: MessageComposerEvents) {
|
||||
when (event) {
|
||||
MessageComposerEvents.ToggleFullScreenState -> isFullScreen.value = !isFullScreen.value
|
||||
MessageComposerEvents.CloseSpecialMode -> {
|
||||
|
|
@ -382,7 +382,7 @@ class MessageComposerPresenter(
|
|||
suggestions = suggestions.toImmutableList(),
|
||||
resolveMentionDisplay = resolveMentionDisplay,
|
||||
resolveAtRoomMentionDisplay = resolveAtRoomMentionDisplay,
|
||||
eventSink = ::handleEvents,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class PinnedMessagesBannerPresenter(
|
|||
expectedPinnedMessagesCount = expectedPinnedMessagesCount,
|
||||
pinnedItems = pinnedItems.value,
|
||||
currentPinnedMessageIndex = currentPinnedMessageIndex,
|
||||
eventSink = ::handleEvent
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -130,7 +130,7 @@ class PinnedMessagesListPresenter(
|
|||
}
|
||||
)
|
||||
|
||||
fun handleEvents(event: PinnedMessagesListEvents) {
|
||||
fun handleEvent(event: PinnedMessagesListEvents) {
|
||||
when (event) {
|
||||
is PinnedMessagesListEvents.HandleAction -> sessionCoroutineScope.handleTimelineAction(event.action, event.event)
|
||||
}
|
||||
|
|
@ -143,7 +143,7 @@ class PinnedMessagesListPresenter(
|
|||
displayThreadSummaries = displayThreadSummaries,
|
||||
userEventPermissions = userEventPermissions,
|
||||
timelineItems = pinnedMessageItems,
|
||||
eventSink = ::handleEvents
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class ReportMessagePresenter(
|
|||
var blockUser by rememberSaveable { mutableStateOf(false) }
|
||||
var result: MutableState<AsyncAction<Unit>> = remember { mutableStateOf(AsyncAction.Uninitialized) }
|
||||
|
||||
fun handleEvents(event: ReportMessageEvents) {
|
||||
fun handleEvent(event: ReportMessageEvents) {
|
||||
when (event) {
|
||||
is ReportMessageEvents.UpdateReason -> reason = event.reason
|
||||
ReportMessageEvents.ToggleBlockUser -> blockUser = !blockUser
|
||||
|
|
@ -66,7 +66,7 @@ class ReportMessagePresenter(
|
|||
reason = reason,
|
||||
blockUser = blockUser,
|
||||
result = result.value,
|
||||
eventSink = ::handleEvents
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -140,7 +140,7 @@ class TimelinePresenter(
|
|||
value = featureFlagService.isFeatureEnabled(FeatureFlags.Threads)
|
||||
}
|
||||
|
||||
fun handleEvents(event: TimelineEvents) {
|
||||
fun handleEvent(event: TimelineEvents) {
|
||||
when (event) {
|
||||
is TimelineEvents.LoadMore -> {
|
||||
if (event.direction == Timeline.PaginationDirection.FORWARDS && timelineMode is Timeline.Mode.Thread) {
|
||||
|
|
@ -289,7 +289,7 @@ class TimelinePresenter(
|
|||
messageShield = messageShield.value,
|
||||
resolveVerifiedUserSendFailureState = resolveVerifiedUserSendFailureState,
|
||||
displayThreadSummaries = displayThreadSummaries,
|
||||
eventSink = ::handleEvents,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class CustomReactionPresenter(
|
|||
target.value = CustomReactionState.Target.None
|
||||
}
|
||||
|
||||
fun handleEvents(event: CustomReactionEvents) {
|
||||
fun handleEvent(event: CustomReactionEvents) {
|
||||
when (event) {
|
||||
is CustomReactionEvents.ShowCustomReactionSheet -> handleShowCustomReactionSheet(event.event)
|
||||
is CustomReactionEvents.DismissCustomReactionSheet -> handleDismissCustomReactionSheet()
|
||||
|
|
@ -71,7 +71,7 @@ class CustomReactionPresenter(
|
|||
target = target.value,
|
||||
selectedEmoji = selectedEmoji,
|
||||
recentEmojis = recentEmojis,
|
||||
eventSink = ::handleEvents,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ class EmojiPickerPresenter(
|
|||
}
|
||||
|
||||
val isInPreview = LocalInspectionMode.current
|
||||
fun handleEvents(event: EmojiPickerEvents) {
|
||||
fun handleEvent(event: EmojiPickerEvents) {
|
||||
when (event) {
|
||||
// For some reason, in preview mode the SearchBar emits this event with an `isActive = true` value automatically
|
||||
is EmojiPickerEvents.ToggleSearchActive -> if (!isInPreview) {
|
||||
|
|
@ -106,7 +106,7 @@ class EmojiPickerPresenter(
|
|||
searchQuery = searchQuery,
|
||||
isSearchActive = isSearchActive,
|
||||
searchResults = emojiResults,
|
||||
eventSink = ::handleEvents,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class ReactionSummaryPresenter(
|
|||
}
|
||||
val targetWithAvatars = populateSenderAvatars(members = membersState.roomMembers().orEmpty().toImmutableList(), summary = target.value)
|
||||
|
||||
fun handleEvents(event: ReactionSummaryEvents) {
|
||||
fun handleEvent(event: ReactionSummaryEvents) {
|
||||
when (event) {
|
||||
is ReactionSummaryEvents.ShowReactionSummary -> target.value = ReactionSummaryState.Summary(
|
||||
reactions = event.reactions.toImmutableList(),
|
||||
|
|
@ -48,7 +48,7 @@ class ReactionSummaryPresenter(
|
|||
}
|
||||
return ReactionSummaryState(
|
||||
target = targetWithAvatars.value,
|
||||
eventSink = ::handleEvents,
|
||||
eventSink = ::handleEvent,
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue