decord/alpha/source/modules/channel/markChannelUnread.tsx

65 lines
1.9 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 10310
// Function ID: 10311
2026-08-25 06:04:03 +00:00
// Name: markChannelUnread
2026-10-09 10:00:15 +00:00
// Dependencies: [6042, 10311, 558, 576, 504, 2]
2026-10-03 08:58:59 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
2026-10-09 10:00:15 +00:00
// Module 10310 (markChannelUnread)
import ReadStateStore2 from "ReadStateStore" /* 6042 */;
import markUnreadDefault from "markUnread" /* 10311 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-08-25 06:04:03 +00:00
const require = globalThis.__r;
2026-10-03 08:58:59 +00:00
const ReadStateStore = ReadStateStore2;
let _require;
2026-10-03 08:58:59 +00:00
const ReadState = ReadStateStore2.ReadState;
2026-10-08 09:57:35 +00:00
const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useCanMarkChannelUnread(arg0) {
2026-10-03 08:58:59 +00:00
let first;
let id;
let tmp6;
_require = arg0;
let tmp = _require;
const obj = require("react");
const cResult = obj.c(3);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [ReadStateStore];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
2026-10-08 09:57:35 +00:00
const fn = function l() {
2026-10-03 08:58:59 +00:00
const tmp = ReadStateStore.canBeUnread(id.id) && ReadStateStore.hasLastMessage(id.id) && !id.isCategory();
return tmp;
};
cResult[1] = arg0;
cResult[2] = fn;
tmp6 = fn;
} else {
tmp6 = cResult[2];
}
const tmpResult = tmp(504);
return tmpResult.useStateFromStores(first, tmp6);
2026-10-08 09:57:35 +00:00
}) : (function useCanMarkChannelUnread(arg0) {
2026-10-03 08:58:59 +00:00
let id;
_require = arg0;
const items = [ReadStateStore];
const obj = require("get initialized");
return obj.useStateFromStores(items, () => {
const tmp = ReadStateStore.canBeUnread(id.id) && ReadStateStore.hasLastMessage(id.id) && !id.isCategory();
return tmp;
});
});
const result = size.fileFinishedImporting("modules/channel/markChannelUnread.tsx");
2026-08-25 06:04:03 +00:00
export default function markChannelUnread(arg0) {
2026-09-01 10:26:29 +00:00
const lastMessageId = ReadState.get(arg0).lastMessageId;
2026-08-25 06:04:03 +00:00
if (null != lastMessageId) {
markUnreadDefault(arg0, lastMessageId);
2026-08-25 06:04:03 +00:00
}
};
2026-10-03 08:58:59 +00:00
export const useCanMarkChannelUnread = tmp2;