Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
50 lines
2 KiB
TypeScript
50 lines
2 KiB
TypeScript
// Module ID: 11674
|
|
// Function ID: 11675
|
|
// Name: ChannelLatestMessageLoadingStatsManager
|
|
// Dependencies: [1074, 7568, 2]
|
|
|
|
// Module 11674 (ChannelLatestMessageLoadingStatsManager)
|
|
import Constants from "Constants" /* 1074 */;
|
|
import Clickstream from "Clickstream" /* 7568 */;
|
|
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;
|