decord/source/modules/app_analytics/clickstream/ClickstreamEvents.tsx

69 lines
3 KiB
TypeScript
Raw Normal View History

// Module ID: 7401
// Function ID: 7402
2026-07-20 16:05:17 +00:00
// Name: getClickstreamDrainEvent
2026-09-02 09:53:35 +00:00
// Dependencies: [673, 2]
2026-07-20 16:05:17 +00:00
// Exports: getClickstreamDrainEvent
// Module 7401 (getClickstreamDrainEvent)
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-09-02 09:53:35 +00:00
import ME from "ME" /* 673 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const AnalyticEvents = ME.AnalyticEvents;
const result = set.fileFinishedImporting("modules/app_analytics/clickstream/ClickstreamEvents.tsx");
2026-07-20 16:05:17 +00:00
export const getClickstreamDrainEvent = function getClickstreamDrainEvent(first, arr) {
2026-07-23 10:11:24 +00:00
const date = new Date();
if (date.GUILD_VIEWED_CLICKSTREAM === first) {
2026-07-29 08:29:29 +00:00
let obj = { time_minus: null, rtc_states: null, guild_ids: null };
obj[0] = arr.map((timestamp) => {
timestamp = timestamp.timestamp;
const time = date.getTime();
return time - timestamp.getTime();
});
obj[1] = arr.map((rtc_state) => rtc_state.rtc_state);
obj[2] = arr.map((guild_id) => guild_id.guild_id);
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
} else if (tmp2.FRIENDS_LIST_VIEWED_CLICKSTREAM === first) {
obj = { time_minus: null, rtc_states: null, tab_opened: null, num_friends: null, now_playing_visible: null, now_playing_num_cards: null };
obj[0] = arr.map((timestamp) => {
timestamp = timestamp.timestamp;
const time = date.getTime();
return time - timestamp.getTime();
});
obj[1] = arr.map((rtc_state) => rtc_state.rtc_state);
obj[2] = arr.map((tab_opened) => tab_opened.tab_opened);
obj[3] = arr.map((num_friends) => num_friends.num_friends);
obj[4] = arr.map((now_playing_visible) => now_playing_visible.now_playing_visible);
obj[5] = arr.map((now_playing_num_cards) => now_playing_num_cards.now_playing_num_cards);
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
} else if (tmp2.CHANNEL_OPENED_CLICKSTREAM === first) {
2026-08-24 06:08:38 +00:00
obj1 = { time_minus: null, rtc_states: null, channel_ids: null, channel_types: null };
2026-07-29 08:29:29 +00:00
obj1[0] = arr.map((timestamp) => {
timestamp = timestamp.timestamp;
const time = date.getTime();
return time - timestamp.getTime();
});
obj1[1] = arr.map((rtc_state) => rtc_state.rtc_state);
obj1[2] = arr.map((channel_id) => channel_id.channel_id);
obj1[3] = arr.map((channel_type) => channel_type.channel_type);
2026-07-20 16:05:17 +00:00
return obj1;
2026-07-29 08:29:29 +00:00
} else if (tmp2.CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM === first) {
obj = { time_minus: null, rtc_states: null, load_duration_ms: null, were_messages_cached: null, is_first_load: null };
obj[0] = arr.map((timestamp) => {
timestamp = timestamp.timestamp;
const time = date.getTime();
return time - timestamp.getTime();
});
obj[1] = arr.map((rtc_state) => rtc_state.rtc_state);
obj[2] = arr.map((load_duration_ms) => load_duration_ms.load_duration_ms);
obj[3] = arr.map((were_messages_cached) => were_messages_cached.were_messages_cached);
obj[4] = arr.map((is_first_load) => is_first_load.is_first_load);
2026-07-20 16:05:17 +00:00
return obj;
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
2026-08-24 06:08:38 +00:00
error = new Error("getClickstreamDrainEvent: Unknown event: " + first);
2026-07-20 16:05:17 +00:00
throw error;
}
};