Files
discord-decomp/sources/modules/spoiler_channels/SpoilerChannelUtils.tsx
T
2026-07-27 16:20:00 +03:00

101 lines
5.2 KiB
TypeScript

/* Metro module 5087; source: modules/spoiler_channels/SpoilerChannelUtils.tsx; dependencies: [1379, 5088, 566, 2] */
function _fun44168(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44168, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:6, offset: 0x011699fc, size: 187 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const channelSpoilerAgreeStore = importDefault(5088) /* metro dependency 5088: ChannelSpoilerAgreeStore */;
const closure = isChannelSpoilerGated;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spoiler_channels/SpoilerChannelUtils.tsx');
exports.useGetSpoilerGatingChannelId = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore], _fun44172, [a0]);
};
exports.isChannelSpoilerGated = closure;
exports.useIsChannelSpoilerGated = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore], _fun44174, [a0]);
};
exports.useShouldShowSpoilerGateForChannelId = function(a0) {
var env0_0 = a0;
return require(dependencyMap[2]).useStateFromStores([ChannelStore, ChannelSpoilerAgreeStore], _fun44176, [a0]);
};
exports.shouldShowSpoilerGateForChannelId = function(a0) {
if (a0 == null) {
return false;
}
return isChannelSpoilerGated(ChannelStore.getChannel(a0));
};
}
function getSpoilerGatingChannelId(a0) { // fn#44169, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:142, offset: 0x01169ab7, size: 153 bytes, params: 2, frame: 14
var id;
var didAgree;
let value = a1;
const value2 = a2;
const r4 = value !== undefined ? value : ChannelSpoilerAgreeStore;
const r5 = value2 !== undefined ? value2 : ChannelStore;
value = null;
if (value != a0) {
if (a0.isSpoilerChannel()) {
didAgree = r4.didAgree;
id = a0.id;
id = Reflect.apply(didAgree, r4, [id]) ? value : a0.id;
return id;
}
if (value == a0.parent_id) {
return value;
}
var channel = r5.getChannel(a0.parent_id);
if (value == channel) {
return value;
}
if (channel.isSpoilerChannel()) {
if (r4.didAgree(channel.id)) {
return value;
}
return channel.id;
}
}
return value;
}
function isChannelSpoilerGated(a0) { // fn#44170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:394, offset: 0x01169b50, size: 55 bytes, params: 2, frame: 15
let value = a1;
const value2 = a2;
value = getSpoilerGatingChannelId(a0, value !== undefined ? value : ChannelSpoilerAgreeStore,
value2 !== undefined ? value2 : ChannelStore);
return value != null;
}
function useGetSpoilerGatingChannelId(a0) { // fn#44171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:559, offset: 0x01169b87, size: 81 bytes, params: 2, frame: 17
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore],
_fun44172, [a0]);
}
function useIsChannelSpoilerGated(a0) { // fn#44173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:758, offset: 0x01169bf9, size: 81 bytes, params: 2, frame: 17
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelSpoilerAgreeStore, ChannelStore],
_fun44174, [a0]);
}
function useShouldShowSpoilerGateForChannelId(a0) { // fn#44175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:915, offset: 0x01169c6b, size: 81 bytes, params: 2, frame: 17
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore, ChannelSpoilerAgreeStore],
_fun44176, [a0]);
}
function _fun44172() { // fn#44172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:641, offset: 0x01169bd8, size: 33 bytes, params: 1, frame: 15
return getSpoilerGatingChannelId(env0_0, ChannelSpoilerAgreeStore, ChannelStore);
}
function _fun44174() { // fn#44174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:836, offset: 0x01169c4a, size: 33 bytes, params: 1, frame: 15
return isChannelSpoilerGated(env0_0, ChannelSpoilerAgreeStore, ChannelStore);
}
function _fun44176() { // fn#44176, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5265:1005, offset: 0x01169cbc, size: 43 bytes, params: 1, frame: 15
return isChannelSpoilerGated(ChannelStore.getChannel(env0_0), ChannelSpoilerAgreeStore, ChannelStore);
}