decord/source/modules/messages/native/ChannelLatestMessageLoadingStatsManager.tsx

56 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 11056
// Function ID: 11057
2026-07-29 08:29:29 +00:00
// Name: start
2026-08-27 16:17:25 +00:00
// Dependencies: [676, 7144, 2]
2026-07-20 16:05:17 +00:00
2026-08-27 16:17:25 +00:00
// Module 11056 (start)
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
2026-08-27 16:17:25 +00:00
import isClickstreamEnabled from "isClickstreamEnabled" /* 7144 */;
2026-08-24 06:08:38 +00:00
import set from "set" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
const AnalyticEvents = ME.AnalyticEvents;
2026-07-29 08:29:29 +00:00
let ChannelLatestMessageLoadingStatsManager;
class ChannelLatestMessageLoadingStatsManager {
constructor(arg0) {
obj = Object.create(new.target.prototype);
obj.label = global;
return obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const prototype = ChannelLatestMessageLoadingStatsManager.prototype;
prototype["start"] = function start(channelId) {
this.latestChannelMessagesLoad = { channelId: channelId.channelId, startMs: Date.now() };
};
prototype["cancel"] = function cancel() {
this.latestChannelMessagesLoad = undefined;
};
prototype["finish"] = function finish(channelId) {
const latestChannelMessagesLoad = this.latestChannelMessagesLoad;
if (null != latestChannelMessagesLoad) {
if (latestChannelMessagesLoad.channelId === channelId.channelId) {
const _Date = Date;
const seenChannelIds2 = ChannelLatestMessageLoadingStatsManager.seenChannelIds;
const diff = Date.now() - latestChannelMessagesLoad.startMs;
const hasItem = seenChannelIds2.has(channelId.channelId);
if (!hasItem) {
const seenChannelIds = tmp10.seenChannelIds;
seenChannelIds.add(channelId.channelId);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let obj = isClickstreamEnabled;
2026-07-29 08:29:29 +00:00
obj = { load_duration_ms: null, were_messages_cached: null, is_first_load: null };
obj[0] = diff;
obj[1] = channelId.areMessagesCached;
obj[2] = !hasItem;
obj.trackClickstream(AnalyticEvents.CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM, obj);
tmp.latestChannelMessagesLoad = undefined;
tmp10 = ChannelLatestMessageLoadingStatsManager;
const tmp12 = !hasItem;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
};
2026-07-23 10:11:24 +00:00
let set = new Set();
2026-07-29 08:29:29 +00:00
ChannelLatestMessageLoadingStatsManager.seenChannelIds = set;
2026-07-23 10:11:24 +00:00
const result = set.fileFinishedImporting("modules/messages/native/ChannelLatestMessageLoadingStatsManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default ChannelLatestMessageLoadingStatsManager;