Files
discord-decomp/sources/modules/hub/HubUnreadUtils.tsx
T
2026-07-28 01:06:53 +03:00

57 lines
3.4 KiB
TypeScript

/* Metro module 14593; source: modules/hub/HubUnreadUtils.tsx; dependencies: [9640, 4605, 566, 21, 9632, 2] */
import SnowflakeUtils from '../../utils/SnowflakeUtils.tsx'; /* Metro dependency 21 */
import ReadStateStore from '../../stores/ReadStateStore.tsx'; /* Metro dependency 4605 */
import GuildDirectoryStore from '../directory_channels/GuildDirectoryStore.tsx'; /* Metro dependency 9640 */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as FluxModule from '../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as GuildDirectoryUtilsModule from '../directory_channels/GuildDirectoryUtils.tsx'; /* Metro dependency 9632 */
function _fun110359(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14790:6, offset: 0x02376562, size: 134 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/hub/HubUnreadUtils.tsx');
exports.useHubUnreadCount = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([GuildDirectoryStore, ReadStateStore], _fun110361, [a0]);
};
function useHubUnreadCount(a0) { // fn#110360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14790:200, offset: 0x023765e8, size: 83 bytes, params: 2, frame: 17
const env0_0 = a0;
return (FluxModule).useStateFromStores([GuildDirectoryStore, ReadStateStore],
_fun110361, [a0]);
function _fun110361() { // fn#110361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14790:271, offset: 0x0237663b, size: 178 bytes, params: 1, frame: 18
if (env0_0 == null) {
return 0;
}
const readStateStoreBinding = ReadStateStore;
const value3 = readStateStoreBinding.ackMessageId(env0_0.id);
var env0_0 = value3;
if (value3 == null) {
return 0;
}
const Object = global.Object;
const values = Object.values;
let value = GuildDirectoryStore.getDirectoryEntries(env0_0.id);
value = Reflect.apply(values, Object, [value ?? ({})]);
value = value.filter(_fun110362);
const Math = global.Math;
const min = Math.min;
const MAX_CATEGORY_SERVERS = (GuildDirectoryUtilsModule).MAX_CATEGORY_SERVERS;
return Reflect.apply(min, Math, [MAX_CATEGORY_SERVERS, value.length]);
function _fun110362({createdAt}) { // fn#110362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14790:421, offset: 0x023766ed, size: 96 bytes, params: 2, frame: 12
const Date = global.Date;
let date = new Date(createdAt);
date = date.getTime();
const defaultImport = SnowflakeUtils;
return date > defaultImport.extractTimestamp(env0_0);
}
}
}
}
global.__d(_fun110359, 14593, [9640, 4605, 566, 21, 9632,
2]) /* metro module 14593, dependencies: [9640, 4605, 566, 21, 9632, 2] */;