decord/alpha/source/modules/messages/useLongestChannelMessageBeforeReply.tsx
github-actions 6eea20b8e1 chore: update source for alpha 348.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/05xxx/module_5014.js (118.4 MB)
2026-09-24 10:59:02 +00:00

47 lines
1.5 KiB
TypeScript

// Module ID: 12799
// Function ID: 12800
// Name: useLongestChannelMessageBeforeReply
// Dependencies: [5049, 504, 2]
// Exports: useLongestChannelMessageBeforeReply
// Module 12799 (useLongestChannelMessageBeforeReply)
import MessageStore from "MessageStore" /* 5049 */;
const require = globalThis.__r;
const require = fn;
const size = fn(2);
const result = size.fileFinishedImporting("modules/messages/useLongestChannelMessageBeforeReply.tsx");
export const useLongestChannelMessageBeforeReply = function useLongestChannelMessageBeforeReply(id, recipientId) {
_require = id;
dependencyMap = recipientId;
const items = [MessageStore];
const items1 = [id, recipientId];
return require("initialize").useStateFromStores(items, () => {
if (null != closure_1) {
const messages = MessageStore.getMessages(closure_0);
const findOldestResult = messages.findOldest((author) => author.author.id === recipientId);
let tmp4 = findOldestResult;
if (null != findOldestResult) {
const toArrayResult = messages.toArray();
for (const item10018 of toArrayResult) {
if (item10018.author.id !== closure_1) {
obj2.return();
break;
} else {
let length;
if (tmp4 != null) {
length = tmp4.content.length;
}
if (tmp8.content.length > length) {
tmp4 = item10018;
}
continue;
}
return tmp4;
}
}
}
}, items1);
};