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

32 lines
2.1 KiB
TypeScript

/* Metro module 15127; source: modules/guild/usePostableChannelCount.tsx; dependencies: [1935, 3784, 661, 566, 483, 2] */
function _fun115321(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#115321, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15324:6, offset: 0x0245c957, size: 178 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
const env0_4 = (require(1935) /* metro dependency 1935: GuildChannelStore */).GUILD_SELECTABLE_CHANNELS_KEY;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const env0_6 = (require(661) /* metro dependency 661: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild/usePostableChannelCount.tsx');
exports.default = useSendMessageChannelCount;
}
function useSendMessageChannelCount(a0) { // fn#115322, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15324:263, offset: 0x0245ca09, size: 108 bytes, params: 2, frame: 16
const env0_0 = a0;
const value = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildChannelStore], _fun115323,
[a0]);
let length = value.length;
const value2 = 0;
length = value2 === length ? value2 : value.filter(function({channel}) {
var moduleValue = importAll(dependencyMap[4]);
var SEND_MESSAGES = Permissions.SEND_MESSAGES;
return PermissionStore.can(moduleValue.combine(SEND_MESSAGES, Permissions.VIEW_CHANNEL), channel);
}).length;
return length;
}
function _fun115323() { // fn#115323, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15324:340, offset: 0x0245ca75, size: 45 bytes, params: 1, frame: 12
return GuildChannelStore.getChannels(env0_0)[GUILD_SELECTABLE_CHANNELS_KEY] ?? [];
}