You've already forked matrix-react-sdk
							
							
				mirror of
				https://github.com/matrix-org/matrix-react-sdk.git
				synced 2025-11-04 11:51:45 +03:00 
			
		
		
		
	Fix room directory events happening in the wrong order for Funnels
This commit is contained in:
		@@ -210,6 +210,10 @@ interface ISendMessageEvent extends IEvent {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
interface IRoomDirectoryEvent extends IEvent {
 | 
					interface IRoomDirectoryEvent extends IEvent {
 | 
				
			||||||
    key: "room_directory";
 | 
					    key: "room_directory";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					interface IRoomDirectoryDoneEvent extends IEvent {
 | 
				
			||||||
 | 
					    key: "room_directory_done";
 | 
				
			||||||
    dur: number; // time spent in the room directory modal
 | 
					    dur: number; // time spent in the room directory modal
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -666,8 +670,8 @@ export default class CountlyAnalytics {
 | 
				
			|||||||
    private queue(args: Omit<IEvent, "timestamp" | "hour" | "dow" | "count"> & Partial<Pick<IEvent, "count">>) {
 | 
					    private queue(args: Omit<IEvent, "timestamp" | "hour" | "dow" | "count"> & Partial<Pick<IEvent, "count">>) {
 | 
				
			||||||
        const {count = 1, ...rest} = args;
 | 
					        const {count = 1, ...rest} = args;
 | 
				
			||||||
        const ev = {
 | 
					        const ev = {
 | 
				
			||||||
            ...rest,
 | 
					 | 
				
			||||||
            ...this.getTimeParams(),
 | 
					            ...this.getTimeParams(),
 | 
				
			||||||
 | 
					            ...rest,
 | 
				
			||||||
            count,
 | 
					            count,
 | 
				
			||||||
            platform: this.appPlatform,
 | 
					            platform: this.appPlatform,
 | 
				
			||||||
            app_version: this.appVersion,
 | 
					            app_version: this.appVersion,
 | 
				
			||||||
@@ -913,8 +917,12 @@ export default class CountlyAnalytics {
 | 
				
			|||||||
        }, roomId);
 | 
					        }, roomId);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public trackRoomDirectoryBegin() {
 | 
				
			||||||
 | 
					        this.track<IRoomDirectoryEvent>("room_directory");
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public trackRoomDirectory(startTime: number) {
 | 
					    public trackRoomDirectory(startTime: number) {
 | 
				
			||||||
        this.track<IRoomDirectoryEvent>("room_directory", {}, null, {
 | 
					        this.track<IRoomDirectoryDoneEvent>("room_directory_done", {}, null, {
 | 
				
			||||||
            dur: CountlyAnalytics.getTimestamp() - startTime,
 | 
					            dur: CountlyAnalytics.getTimestamp() - startTime,
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -932,7 +940,7 @@ export default class CountlyAnalytics {
 | 
				
			|||||||
        key: E["key"],
 | 
					        key: E["key"],
 | 
				
			||||||
        segments?: Omit<E["segmentation"], "room_id" | "num_users" | "is_encrypted" | "is_public">,
 | 
					        segments?: Omit<E["segmentation"], "room_id" | "num_users" | "is_encrypted" | "is_public">,
 | 
				
			||||||
        roomId?: string,
 | 
					        roomId?: string,
 | 
				
			||||||
        args?: Partial<Pick<E, "dur" | "sum">>,
 | 
					        args?: Partial<Pick<E, "dur" | "sum" | "timestamp">>,
 | 
				
			||||||
        anonymous = false,
 | 
					        anonymous = false,
 | 
				
			||||||
    ) {
 | 
					    ) {
 | 
				
			||||||
        if (this.disabled && !anonymous) return;
 | 
					        if (this.disabled && !anonymous) return;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,6 +50,7 @@ export default class RoomDirectory extends React.Component {
 | 
				
			|||||||
    constructor(props) {
 | 
					    constructor(props) {
 | 
				
			||||||
        super(props);
 | 
					        super(props);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        CountlyAnalytics.instance.trackRoomDirectoryBegin();
 | 
				
			||||||
        this.startTime = CountlyAnalytics.getTimestamp();
 | 
					        this.startTime = CountlyAnalytics.getTimestamp();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        const selectedCommunityId = GroupFilterOrderStore.getSelectedTags()[0];
 | 
					        const selectedCommunityId = GroupFilterOrderStore.getSelectedTags()[0];
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user