Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Add isLocation to ComposerEvent analytics events (#11187)
Browse files Browse the repository at this point in the history
  • Loading branch information
andybalaam authored Jul 4, 2023
1 parent 90b572f commit 54ffce9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/components/views/rooms/EditMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ class EditMessageComposer extends React.Component<IEditMessageComposerProps, ISt
PosthogAnalytics.instance.trackEvent<ComposerEvent>({
eventName: "Composer",
isEditing: true,
isLocation: false,
inThread: !!editedEvent?.getThread(),
isReply: !!editedEvent.replyEventId,
});
Expand Down
1 change: 1 addition & 0 deletions src/components/views/rooms/SendMessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ export class SendMessageComposer extends React.Component<ISendMessageComposerPro
const posthogEvent: ComposerEvent = {
eventName: "Composer",
isEditing: false,
isLocation: false,
isReply: !!this.props.replyToEvent,
inThread: this.props.relation?.rel_type === THREAD_RELATION_TYPE.name,
};
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/rooms/wysiwyg_composer/utils/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export async function sendMessage(
const posthogEvent: ComposerEvent = {
eventName: "Composer",
isEditing: false,
isLocation: false,
isReply: Boolean(replyToEvent),
// TODO thread
inThread: relation?.rel_type === THREAD_RELATION_TYPE.name,
Expand Down Expand Up @@ -199,6 +200,7 @@ export async function editMessage(
PosthogAnalytics.instance.trackEvent<ComposerEvent>({
eventName: "Composer",
isEditing: true,
isLocation: false,
inThread: Boolean(editedEvent?.getThread()),
isReply: Boolean(editedEvent.replyEventId),
});
Expand Down

0 comments on commit 54ffce9

Please sign in to comment.