decord/stable/source/modules/messages/useOnMessageSend.tsx
github-actions 57c2214117 chore: update source for stable 347.12
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4973.js (118.4 MB)
2026-09-29 21:26:22 +00:00

52 lines
1.7 KiB
TypeScript

// Module ID: 17233
// Function ID: 17234
// Name: useOnMessageSend
// Dependencies: [19, 1074, 573, 2]
// Exports: default
// Module 17233 (useOnMessageSend)
import DispatcherDefault from "Dispatcher" /* 573 */;
import noop from "module_19" /* 19 */;
const MessageStates = fn(1074).MessageStates;
const size = fn(2);
const result = size.fileFinishedImporting("modules/messages/useOnMessageSend.tsx");
export default function useOnMessageSend(arg0) {
closure_0 = arg0;
dependencyMap = tmp;
const items = [arg0, arg1];
const effect = noop.useEffect(() => {
function handleMessage(channelId) {
let tmp2 = undefined !== handleMessageCreate;
if (tmp2) {
tmp2 = channelId.channelId !== tmp;
}
if (!tmp2) {
handleMessage();
}
}
function handleMessageCreate(optimistic) {
optimistic = optimistic.optimistic;
if (!optimistic) {
optimistic = optimistic.message.state === constants.SENDING;
}
if (optimistic) {
if (!tmp3) {
handleMessage();
}
tmp3 = undefined !== handleMessageCreate && optimistic.channelId !== tmp2;
}
}
const subscription = closure_0(573).subscribe("MESSAGE_CREATE", handleMessageCreate);
let obj = closure_0(573);
const subscription1 = closure_0(573).subscribe("UPLOAD_START", handleMessage);
let obj2 = closure_0(573);
const subscription2 = closure_0(573).subscribe("CALL_CREATE", handleMessage);
return () => {
DispatcherDefault.unsubscribe("MESSAGE_CREATE", handleMessageCreate);
DispatcherDefault.unsubscribe("UPLOAD_START", handleMessage);
DispatcherDefault.unsubscribe("CALL_CREATE", handleMessage);
};
}, items);
};