decord/beta/source/modules/messages/native/ChannelLatestMessageLoadingStatsManager.tsx
github-actions be75018105 chore: update source for beta 347.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4941.js (118.4 MB)
2026-09-21 13:40:21 +00:00

50 lines
2 KiB
TypeScript

// Module ID: 11792
// Function ID: 11793
// Name: ChannelLatestMessageLoadingStatsManager
// Dependencies: [1074, 7707, 2]
// Module 11792 (ChannelLatestMessageLoadingStatsManager)
import Constants from "Constants" /* 1074 */;
import Clickstream from "Clickstream" /* 7707 */;
import size from "module_2" /* 2 */;
const AnalyticEvents = Constants.AnalyticEvents;
let ChannelLatestMessageLoadingStatsManager;
class ChannelLatestMessageLoadingStatsManager {
constructor(arg0) {
obj = Object.create(new.target.prototype);
obj.label = global;
return obj;
}
}
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);
}
const obj2 = { load_duration_ms: diff, were_messages_cached: channelId.areMessagesCached, is_first_load: !hasItem };
Clickstream.trackClickstream(AnalyticEvents.CHANNEL_LATEST_MESSAGES_LOADED_CLICKSTREAM, obj2);
tmp.latestChannelMessagesLoad = undefined;
tmp10 = ChannelLatestMessageLoadingStatsManager;
const tmp12 = !hasItem;
}
}
};
ChannelLatestMessageLoadingStatsManager.seenChannelIds = new Set();
const result = size.fileFinishedImporting("modules/messages/native/ChannelLatestMessageLoadingStatsManager.tsx");
export default ChannelLatestMessageLoadingStatsManager;