decord/source/modules/opt_in_channels/useBatchUpdateChannelSettings.tsx

82 lines
2.9 KiB
TypeScript
Raw Normal View History

2026-07-23 10:11:24 +00:00
// Module ID: 9978
// Function ID: 77102
2026-07-20 16:05:17 +00:00
// Name: resetStoreState
2026-07-23 10:11:24 +00:00
// Dependencies: [31, 5076, 4325, 653, 686, 566, 5072, 9979, 9976, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-23 10:11:24 +00:00
// Module 9978 (resetStoreState)
import result from "result";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import closure_5 from "_isNativeReflectConstruct";
import { AnalyticsSections } from "ME";
const require = arg1;
2026-07-20 16:05:17 +00:00
function resetStoreState(guildId) {
2026-07-23 10:11:24 +00:00
let obj = importDefault(686);
2026-07-20 16:05:17 +00:00
obj = { type: "CLEAR_PENDING_CHANNEL_AND_ROLE_UPDATES", guildId };
obj.dispatch(obj);
}
2026-07-23 10:11:24 +00:00
let result = require("_isNativeReflectConstruct").fileFinishedImporting("modules/opt_in_channels/useBatchUpdateChannelSettings.tsx");
2026-07-20 16:05:17 +00:00
export default function useBatchUpdateChannelSettings(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
let obj = _require(566);
let items = [closure_5];
const stateFromStores = obj.useStateFromStores(items, () => outer1_5.getPendingChannelUpdates(closure_0));
let items1 = [arg0];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-07-23 10:11:24 +00:00
outer1_7(closure_0);
2026-07-20 16:05:17 +00:00
return () => {
2026-07-23 10:11:24 +00:00
outer2_7(outer1_0);
2026-07-20 16:05:17 +00:00
};
}, items1);
const items2 = [arg0, stateFromStores];
const effect1 = React.useEffect(() => {
if (null != stateFromStores) {
2026-07-23 10:11:24 +00:00
const result = callback(outer1_2[6]).updateOptInChannelsBatched(callback, stateFromStores);
const obj = callback(outer1_2[6]);
2026-07-20 16:05:17 +00:00
}
}, items2);
obj = {
2026-07-23 10:11:24 +00:00
onChannelClick: React.useCallback((guildId, channelId, closure_0) => {
const isChannelOptedInResult = outer1_5.isChannelOptedIn(guildId, channelId);
2026-07-20 16:05:17 +00:00
let isCollapsedResult = !isChannelOptedInResult;
if (isCollapsedResult) {
2026-07-23 10:11:24 +00:00
isCollapsedResult = outer1_4.isCollapsed(closure_0);
2026-07-20 16:05:17 +00:00
}
if (isCollapsedResult) {
2026-07-23 10:11:24 +00:00
isCollapsedResult = null != closure_0;
2026-07-20 16:05:17 +00:00
}
if (isCollapsedResult) {
2026-07-23 10:11:24 +00:00
let obj = callback(outer1_2[7]);
obj.categoryExpand(closure_0);
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let obj1 = callback(outer1_2[8]);
2026-07-20 16:05:17 +00:00
if (obj1.hasNotSetUpChannelOptIn(guildId)) {
2026-07-23 10:11:24 +00:00
if (channelId === closure_0) {
2026-07-20 16:05:17 +00:00
obj = {};
const _Set2 = Set;
const items = [channelId];
const set = new Set(items);
obj.include = set;
2026-07-23 10:11:24 +00:00
const result = callback(outer1_2[8]).optIntoAllChannelsForExistingMember(guildId, obj);
const obj7 = callback(outer1_2[8]);
2026-07-20 16:05:17 +00:00
} else {
obj = {};
const _Set = Set;
const items1 = [channelId];
const set1 = new Set(items1);
obj.exclude = set1;
2026-07-23 10:11:24 +00:00
const result1 = callback(outer1_2[8]).optIntoAllChannelsForExistingMember(guildId, obj);
const obj5 = callback(outer1_2[8]);
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-23 10:11:24 +00:00
const obj3 = callback(outer1_2[6]);
obj1 = { section: outer1_6.CHANNEL_BROWSER };
2026-07-20 16:05:17 +00:00
const result2 = obj3.updateOptInChannelsImmediate(guildId, channelId, !isChannelOptedInResult, obj1);
}
}, [])
};
return obj;
};