decord/beta/source/modules/hub/HubUnreadUtils.tsx

106 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-10-02 13:37:24 +00:00
// Module ID: 15843
// Function ID: 15844
// Name: HubUnreadUtils
2026-10-02 13:37:24 +00:00
// Dependencies: [11688, 4852, 558, 576, 11, 11680, 504, 2]
2026-10-02 13:37:24 +00:00
// Module 15843 (HubUnreadUtils)
import GuildDirectoryUtils from "GuildDirectoryUtils" /* 11680 */;
import GuildDirectoryStore from "GuildDirectoryStore" /* 11688 */;
import ReadStateStore from "ReadStateStore" /* 4852 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
const require = globalThis.__r;
2026-10-01 14:13:23 +00:00
let _require;
2026-10-02 13:37:24 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? ((arg0) => {
let closure_0;
let first;
let tmp7;
let tmp8;
_require = arg0;
const tmp = _require;
const obj = require("react");
const cResult = obj.c(4);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [GuildDirectoryStore, ];
items[1] = ReadStateStore;
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
const fn = function l() {
if (null == closure_0) {
return 0;
} else {
const ackMessageIdResult = ReadStateStore.ackMessageId(tmp.id);
if (null == ackMessageIdResult) {
return 0;
} else {
const _Object = Object;
let directoryEntries = GuildDirectoryStore.getDirectoryEntries(tmp.id);
if (directoryEntries == null) {
directoryEntries = {};
}
const values2 = values(directoryEntries);
const _Math = Math;
const found = values2.filter((createdAt) => {
const date = new Date(createdAt.createdAt);
const time = date.getTime();
const obj2 = closure_2_1(closure_2_2[4]);
return time > obj2.extractTimestamp(ackMessageIdResult);
});
return Math.min(GuildDirectoryUtils.MAX_CATEGORY_SERVERS, found.length);
}
}
};
const items1 = [arg0];
cResult[1] = arg0;
cResult[2] = fn;
cResult[3] = items1;
tmp8 = items1;
tmp7 = fn;
} else {
tmp7 = cResult[2];
tmp8 = cResult[3];
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStores(first, tmp7, tmp8);
}) : ((arg0) => {
2026-10-01 14:13:23 +00:00
let closure_0;
_require = arg0;
const items = [GuildDirectoryStore, ReadStateStore];
const items1 = [arg0];
2026-10-01 14:13:23 +00:00
const obj = require("get initialized");
return obj.useStateFromStores(items, () => {
if (null == closure_0) {
return 0;
} else {
const ackMessageIdResult = ReadStateStore.ackMessageId(tmp.id);
if (null == ackMessageIdResult) {
return 0;
} else {
2026-10-01 14:13:23 +00:00
const _Object = Object;
let directoryEntries = GuildDirectoryStore.getDirectoryEntries(tmp.id);
if (directoryEntries == null) {
directoryEntries = {};
}
2026-10-01 14:13:23 +00:00
const values2 = values(directoryEntries);
const _Math = Math;
2026-10-01 14:13:23 +00:00
const found = values2.filter((createdAt) => {
const date = new Date(createdAt.createdAt);
2026-10-01 14:13:23 +00:00
const time = date.getTime();
2026-10-02 13:37:24 +00:00
const obj2 = closure_2_1(closure_2_2[4]);
2026-10-01 14:13:23 +00:00
return time > obj2.extractTimestamp(ackMessageIdResult);
});
return Math.min(GuildDirectoryUtils.MAX_CATEGORY_SERVERS, found.length);
}
}
}, items1);
2026-10-02 13:37:24 +00:00
});
const result = size.fileFinishedImporting("modules/hub/HubUnreadUtils.tsx");
export const useHubUnreadCount = tmp2;