This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+35
View File
@@ -0,0 +1,35 @@
// Metro module 15585 (f15586).
import { useEffect } from "react";
import { MessageStates } from "../../Constants";
import Dispatcher from "../../Dispatcher";
export default function useOnMessageSend(a0) {
let c22216_0 = a0;
let r5 = arguments[1];
if (r5 === void 0) {
r5 = void 0;
}
let c22216_1 = r5;
useEffect(() => {
let handleMessageCreate2;
const handleMessage2 = function handleMessage(a0) {
if (!(c22216_1 !== void 0 && a0.channelId !== c22216_1)) {
c22216_0();
}
};
handleMessageCreate2 = function handleMessageCreate(a0) {
if (a0.optimistic || a0.message.state === MessageStates.SENDING) {
if (!(c22216_1 !== void 0 && a0.channelId !== c22216_1)) {
c22216_0();
}
}
};
Dispatcher.subscribe("MESSAGE_CREATE", handleMessageCreate2);
Dispatcher.subscribe("UPLOAD_START", handleMessage2);
Dispatcher.subscribe("CALL_CREATE", handleMessage2);
return () => {
Dispatcher.unsubscribe("MESSAGE_CREATE", handleMessageCreate2);
Dispatcher.unsubscribe("UPLOAD_START", handleMessage2);
Dispatcher.unsubscribe("CALL_CREATE", handleMessage2);
};
}, [a0, r5]);
};