Send composer analytics when sending a message (#1288)
Composer event are not sent to posthog when sending messages. After investigation I've found that in `MessageComposerPresenter` the `analyticsService.capture()` call is invoked in the `SetMode` event handler rather than in the `SendMessage` event handler. This change should result in the desired behavior.
This commit is contained in:
parent
3e0390e374
commit
f136a308b2
1 changed files with 8 additions and 8 deletions
|
|
@ -148,14 +148,6 @@ class MessageComposerPresenter @Inject constructor(
|
||||||
)
|
)
|
||||||
is MessageComposerEvents.SetMode -> {
|
is MessageComposerEvents.SetMode -> {
|
||||||
messageComposerContext.composerMode = event.composerMode
|
messageComposerContext.composerMode = event.composerMode
|
||||||
analyticsService.capture(
|
|
||||||
Composer(
|
|
||||||
inThread = messageComposerContext.composerMode.inThread,
|
|
||||||
isEditing = messageComposerContext.composerMode.isEditing,
|
|
||||||
isReply = messageComposerContext.composerMode.isReply,
|
|
||||||
messageType = Composer.MessageType.Text,
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
MessageComposerEvents.AddAttachment -> localCoroutineScope.launch {
|
MessageComposerEvents.AddAttachment -> localCoroutineScope.launch {
|
||||||
showAttachmentSourcePicker = true
|
showAttachmentSourcePicker = true
|
||||||
|
|
@ -238,6 +230,14 @@ class MessageComposerPresenter @Inject constructor(
|
||||||
message.html,
|
message.html,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
analyticsService.capture(
|
||||||
|
Composer(
|
||||||
|
inThread = capturedMode.inThread,
|
||||||
|
isEditing = capturedMode.isEditing,
|
||||||
|
isReply = capturedMode.isReply,
|
||||||
|
messageType = Composer.MessageType.Text, // Set proper type when we'll be sending other types of messages.
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun CoroutineScope.sendAttachment(
|
private fun CoroutineScope.sendAttachment(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue