Add analytics event for pinned messages
This commit is contained in:
parent
bce710e34e
commit
08d1b6ceae
8 changed files with 48 additions and 8 deletions
|
@ -42,6 +42,7 @@ import { OpenForwardDialogPayload } from "../../../dispatcher/payloads/OpenForwa
|
|||
import { createRedactEventDialog } from "../dialogs/ConfirmRedactDialog";
|
||||
import { ShowThreadPayload } from "../../../dispatcher/payloads/ShowThreadPayload";
|
||||
import PinningUtils from "../../../utils/PinningUtils.ts";
|
||||
import PosthogTrackers from "../../../PosthogTrackers.ts";
|
||||
|
||||
const AVATAR_SIZE = "32px";
|
||||
|
||||
|
@ -152,6 +153,8 @@ function PinMenu({ event, room, permalinkCreator }: PinMenuProps): JSX.Element {
|
|||
* View the event in the timeline.
|
||||
*/
|
||||
const onViewInTimeline = useCallback(() => {
|
||||
PosthogTrackers.trackInteraction("PinnedMessageListViewTimeline");
|
||||
|
||||
dis.dispatch<ViewRoomPayload>({
|
||||
action: Action.ViewRoom,
|
||||
event_id: event.getId(),
|
||||
|
@ -173,6 +176,7 @@ function PinMenu({ event, room, permalinkCreator }: PinMenuProps): JSX.Element {
|
|||
*/
|
||||
const onUnpin = useCallback(async (): Promise<void> => {
|
||||
await PinningUtils.pinOrUnpinEvent(matrixClient, event);
|
||||
PosthogTrackers.trackPinUnpinMessage("Unpin", "MessagePinningList");
|
||||
}, [event, matrixClient]);
|
||||
|
||||
const contentActionable = isContentActionable(event);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue