Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
// Module ID: 12592
|
|
// Function ID: 12593
|
|
// Name: useCommunicationDisabledCountdownCleanup
|
|
// Dependencies: [19, 7542, 12593, 2]
|
|
// Exports: useCommunicationDisabledCountdownCleanup
|
|
|
|
// Module 12592 (useCommunicationDisabledCountdownCleanup)
|
|
import noop from "module_19" /* 19 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
({ useEffect: c2, useRef: c3 } = noop);
|
|
let result = size.fileFinishedImporting("modules/guild_communication_disabled/useCommunicationDisabledCountdownCleanup.tsx");
|
|
|
|
export const useCommunicationDisabledCountdownCleanup = function useCommunicationDisabledCountdownCleanup(guildMember) {
|
|
importDefault = guildMember;
|
|
let obj = guildMember;
|
|
if (guildMember == null) {
|
|
obj = {};
|
|
}
|
|
({ communicationDisabledUntil, userId } = obj);
|
|
const guildId = obj.guildId;
|
|
if (null != communicationDisabledUntil) {
|
|
const _Date2 = Date;
|
|
let parsed = Date.parse(communicationDisabledUntil);
|
|
} else {
|
|
const _Date = Date;
|
|
parsed = Date.now();
|
|
}
|
|
const tmpResult = require("useCountdown")(parsed);
|
|
const seconds = tmpResult.seconds;
|
|
seconds(null);
|
|
const items = [guildId, userId, seconds, communicationDisabledUntil, guildMember];
|
|
guildId(() => {
|
|
if (null != closure_0) {
|
|
if (null != guildId) {
|
|
if (null != userId) {
|
|
let tmp5 = seconds <= 0;
|
|
if (tmp5) {
|
|
tmp5 = null == ref.current;
|
|
}
|
|
if (tmp5) {
|
|
const _setTimeout = setTimeout;
|
|
ref.current = setTimeout(() => {
|
|
const result = closure_0(userId[2]).clearGuildMemberTimeout(guildId, closure_1_1);
|
|
}, 1000);
|
|
}
|
|
return () => {
|
|
if (null != ref.current) {
|
|
const _clearTimeout = clearTimeout;
|
|
clearTimeout(tmp.current);
|
|
tmp.current = null;
|
|
}
|
|
};
|
|
}
|
|
}
|
|
}
|
|
clearTimeout(ref.current);
|
|
}, items);
|
|
return tmpResult;
|
|
};
|