decord/beta/source/modules/messages/useLongestChannelMessageBeforeReply.tsx

50 lines
1.6 KiB
TypeScript
Raw Normal View History

// Module ID: 11943
// Function ID: 11944
// Name: useLongestChannelMessageBeforeReply
// Dependencies: [5056, 504, 2]
// Exports: useLongestChannelMessageBeforeReply
// Module 11943 (useLongestChannelMessageBeforeReply)
import MessageStore from "MessageStore" /* 5056 */;
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, dependencyMap;
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];
2026-10-01 14:13:23 +00:00
const obj = require("get initialized");
return obj.useStateFromStores(items, () => {
if (null != recipientId) {
const messages = MessageStore.getMessages(id);
const findOldestResult = messages.findOldest((author) => author.author.id === recipientId);
let tmp4 = findOldestResult;
if (null != findOldestResult) {
const toArrayResult = messages.toArray();
for (const item10018 of toArrayResult) {
2026-10-01 14:13:23 +00:00
if (item10018.author.id !== recipientId) {
obj2.return();
break;
} else {
2026-10-01 14:13:23 +00:00
let length1;
let length = tmp8.content.length;
if (tmp4 != null) {
2026-10-01 14:13:23 +00:00
length1 = tmp4.content.length;
}
2026-10-01 14:13:23 +00:00
if (length > length1) {
tmp4 = item10018;
}
continue;
}
return tmp4;
}
}
}
}, items1);
};