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

117 lines
4.9 KiB
TypeScript

/* Metro module 5088; source: modules/spoiler_channels/ChannelSpoilerAgreeStore.tsx; dependencies: [6, 7, 15, 17, 18, 1226, 566, 694, 2] */
function _fun44178(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#44178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5266:6, offset: 0x01169d12, size: 308 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(6) /* metro dependency 6 */;
const env0_1 = importDefault(7) /* metro dependency 7 */;
const env0_2 = importDefault(15) /* metro dependency 15 */;
const env0_3 = importDefault(17) /* metro dependency 17 */;
const env0_4 = importDefault(18) /* metro dependency 18 */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
object = {users: {}};
const DeviceSettingsStore = (importDefault(566) /* metro dependency 566: flux */).DeviceSettingsStore;
let value = _fun44182(DeviceSettingsStore);
value.displayName = 'ChannelSpoilerAgreeStore';
value.persistKey = 'ChannelSpoilerAgreeStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */,
{CHANNEL_SPOILER_AGREE: CHANNEL_SPOILER_AGREE, CHANNEL_SPOILER_AGREE_CLEAR: CHANNEL_SPOILER_AGREE_CLEAR});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/spoiler_channels/ChannelSpoilerAgreeStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_44179() { // fn#44179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5266:158, offset: 0x01169e46, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_44179_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun44182(a0) { // fn#44182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5266:374, offset: 0x01169ea4, size: 137 bytes, params: 2, frame: 16
const closure = ChannelSpoilerAgreeStore;
env0_4(closure, a0);
return env0_1(closure, [{key: 'initialize', value: function(a0) {
this.waitFor(AuthenticationStore);
env1_6 = a0 == null ? {users: {}} : a0.users != null ? {users: a0.users} : {users: {}};
}}, {key: 'didAgree', value: value_44185}, {key: 'getState', value: value_44186}, {key: 'getUserAgnosticState',
value: value_44187}]);
}
function CHANNEL_SPOILER_AGREE({channelId}) { // fn#44188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5266:1206, offset: 0x01169fc8, size: 106 bytes, params: 2, frame: 13
const id = AuthenticationStore.getId();
if (id == null) {
return false;
}
let users = env0_6.users;
if (users[id] == null) {
env0_6.users[id] = {channels: {}};
}
users = env0_6.users;
users[id].channels[channelId] = true;
}
function CHANNEL_SPOILER_AGREE_CLEAR({channelId}) { // fn#44189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5266:1392, offset: 0x0116a032, size: 86 bytes, params: 2, frame: 13
var r1;
var r0;
var value4;
const id = AuthenticationStore.getId();
const value3 = id != null;
if (value3) {
value4 = env0_6.users[id] != null;
if (value4) {
delete env0_6.users[id].channels[channelId];
r1 = undefined;
} else {
r1 = value4;
}
r0 = r1;
} else {
r0 = value3;
}
return r0;
}
function value_44185(a0) { // fn#44185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5266:828, offset: 0x01169f78, size: 80 bytes, params: 2, frame: 13
var r1;
var r0;
var property;
if (a0 == null) {
return false;
}
const value = environment.__proto__;
const id = AuthenticationStore.getId();
const value3 = id != null;
if (value3) {
property = env1_6.users[id];
r1 = property == null ? undefined : property.channels[a0];
r1 = !!r1 && r1;
r0 = r1;
} else {
r0 = value3;
}
return r0;
}