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

54 lines
2 KiB
TypeScript
Raw Normal View History

2026-07-31 08:44:05 +00:00
// Module ID: 10916
// Function ID: 10917
2026-07-29 08:29:29 +00:00
// Name: start
2026-07-31 08:44:05 +00:00
// Dependencies: [676, 5729, 2]
2026-07-20 16:05:17 +00:00
2026-07-31 08:44:05 +00:00
// Module 10916 (start)
2026-07-23 10:11:24 +00:00
import { AnalyticEvents } from "ME";
2026-07-29 08:29:29 +00:00
import set from "set";
2026-07-23 10:11:24 +00:00
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-07-31 08:44:05 +00:00
let obj = require(5729) /* 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;