decord/source/modules/threads/MessageCountUtils.tsx

71 lines
2.2 KiB
TypeScript
Raw Normal View History

// Module ID: 7939
// Function ID: 7940
// Name: MessageCountUtils
// Dependencies: [1113, 11, 1114, 2]
2026-07-29 08:29:29 +00:00
// Exports: formatMessageCountLabel, formatMobileMessageCountLabel, getMessageCountText, shouldUseOldMaxMessageCount
2026-07-20 16:05:17 +00:00
// Module 7939 (MessageCountUtils)
import SnowflakeUtilsDefault from "SnowflakeUtils" /* 11 */;
import util from "util" /* 1114 */;
import ThreadConstants from "ThreadConstants" /* 1113 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
function _formatMessageCountLabel(count, iTS3Xe, id) {
let str = "0";
if (null != count) {
str = "0";
if (count >= 0) {
SnowflakeUtilsDefault;
2026-07-29 08:29:29 +00:00
if (null == id) {
let str3 = "50+";
str = str3;
}
let str4 = "100k+";
if (count < React3) {
2026-07-29 08:29:29 +00:00
const _HermesInternal = HermesInternal;
str4 = "" + count;
}
str3 = str4;
}
}
if ("0" === str) {
const intl2 = util.intl;
let stringResult = intl2.string(util.t.eXHkhl);
2026-07-29 08:29:29 +00:00
} else {
const intl = util.intl;
const obj = { count: str };
2026-07-29 08:29:29 +00:00
stringResult = intl.formatToPlainString(iTS3Xe, obj);
}
return stringResult;
2026-07-20 16:05:17 +00:00
}
({ MAX_THREAD_MESSAGE_COUNT: c3, MAX_THREAD_MESSAGE_COUNT_OLD: closure_4 } = ThreadConstants);
const result = size.fileFinishedImporting("modules/threads/MessageCountUtils.tsx");
2026-07-29 08:29:29 +00:00
export const shouldUseOldMaxMessageCount = function shouldUseOldMaxMessageCount(arg0) {
return SnowflakeUtilsDefault.compare("992549565104128000", arg0) > -1;
2026-07-29 08:29:29 +00:00
};
export const getMessageCountText = function getMessageCountText(stateFromStores, id) {
2026-07-20 16:05:17 +00:00
if (null != stateFromStores) {
if (stateFromStores >= 0) {
SnowflakeUtilsDefault;
2026-07-20 16:05:17 +00:00
if (null == id) {
let str = "50+";
return str;
}
let str2 = "100k+";
if (stateFromStores < React3) {
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
str2 = "" + stateFromStores;
}
str = str2;
}
}
return "0";
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
export const formatMobileMessageCountLabel = function formatMobileMessageCountLabel(count, id) {
return _formatMessageCountLabel(count, util.t.iTS3Xe, id);
2026-07-20 16:05:17 +00:00
};
export const formatMessageCountLabel = function formatMessageCountLabel(count, id) {
return _formatMessageCountLabel(count, util.t.rfAXDV, id);
2026-07-20 16:05:17 +00:00
};