68 lines
3.8 KiB
TypeScript
68 lines
3.8 KiB
TypeScript
/* Metro module 6632; source: modules/guild_role_subscriptions/useChannelRoleSubscriptionStatus.tsx; dependencies: [1936, 1379, 3784, 661, 566, 2] */
|
|
function _fun52516(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6810:6, offset: 0x0132ef7f, size: 199 bytes, params: 8, frame: 20
|
|
let env0_0 = require;
|
|
const closure = getChannelRoleSubscriptionStatus;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const gatedChannelStore = importDefault(1936) /* metro dependency 1936: GatedChannelStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
|
|
const env0_5 = (require(661) /* metro dependency 661: Constants */).Permissions;
|
|
const env0_6 = {'needSubscriptionToAccess': false, 'isSubscriptionGated': false};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_role_subscriptions/useChannelRoleSubscriptionStatus.tsx');
|
|
exports.default = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[4]).useStateFromStoresObject([ChannelStore, GatedChannelStore, PermissionStore],
|
|
_fun52519, [a0]);
|
|
};
|
|
exports.getChannelRoleSubscriptionStatus = closure;
|
|
}
|
|
|
|
function getChannelRoleSubscriptionStatus(a0) { // fn#52517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6810:203, offset: 0x0132f046, size: 209 bytes, params: 2, frame: 17
|
|
var r0;
|
|
var isGuildVocal2;
|
|
var can;
|
|
let value = a1;
|
|
const value2 = a2;
|
|
const value3 = a3;
|
|
const r2 = value !== undefined ? value : ChannelStore;
|
|
const r3 = value2 !== undefined ? value2 : GatedChannelStore;
|
|
const r6 = value3 !== undefined ? value3 : PermissionStore;
|
|
value = r2.getChannel(a0);
|
|
if (value == null) {
|
|
if (value == null) {
|
|
r0 = env0_6;
|
|
} else if (r3.isChannelGated(value.guild_id, value.id)) {
|
|
isGuildVocal2 = value.isGuildVocal();
|
|
can = r6.can;
|
|
r0 = {isSubscriptionGated: true, needSubscriptionToAccess: isGuildVocal2 ? !Reflect.apply(can, r6,
|
|
[Permissions.CONNECT, value]) : !Reflect.apply(can, r6, [Permissions.VIEW_CHANNEL, value])};
|
|
} else {
|
|
r0 = env0_6;
|
|
}
|
|
} else if (value.isRoleSubscriptionTemplatePreviewChannel()) {
|
|
r0 = {'isSubscriptionGated': true, 'needSubscriptionToAccess': true};
|
|
} else if (value == null) {
|
|
r0 = env0_6;
|
|
} else if (r3.isChannelGated(value.guild_id, value.id)) {
|
|
isGuildVocal2 = value.isGuildVocal();
|
|
can = r6.can;
|
|
r0 = {isSubscriptionGated: true, needSubscriptionToAccess: isGuildVocal2 ? !Reflect.apply(can, r6,
|
|
[Permissions.CONNECT, value]) : !Reflect.apply(can, r6, [Permissions.VIEW_CHANNEL, value])};
|
|
} else {
|
|
r0 = env0_6;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function useChannelRoleSubscriptionStatus(a0) { // fn#52518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6810:666, offset: 0x0132f117, size: 90 bytes, params: 2, frame: 17
|
|
const env0_0 = a0;
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelStore, GatedChannelStore,
|
|
PermissionStore], _fun52519, [a0]);
|
|
}
|
|
|
|
function _fun52519() { // fn#52519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6810:760, offset: 0x0132f171, size: 34 bytes, params: 1, frame: 17
|
|
return getChannelRoleSubscriptionStatus(env0_0, ChannelStore, GatedChannelStore, PermissionStore);
|
|
}
|
|
|