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

104 lines
7.6 KiB
TypeScript

/* Metro module 14567; source: modules/guild_scheduled_events/useGuildHasLiveChannelNotice.tsx; dependencies: [31, 4810, 1384, 4492, 1379, 3784, 4300, 14568, 1385, 482, 14569, 566, 9127, 14570, 6273, 6268, 2] */
function _fun110170(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:6, offset: 0x0236d6a0, size: 290 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const stageChannelParticipantStore = importDefault(4810) /* metro dependency 4810: StageChannelParticipantStore */;
const stageInstanceStore = importDefault(1384) /* metro dependency 1384: StageInstanceStore */;
const applicationStreamingStore = importDefault(4492) /* metro dependency 4492: ApplicationStreamingStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const sortedVoiceStateStore = importDefault(4300) /* metro dependency 4300: SortedVoiceStateStore */;
const liveChannelNoticesStore = importDefault(14568) /* metro dependency 14568: LiveChannelNoticesStore */;
const env0_11 = (require(1385) /* metro dependency 1385: GuildScheduledEventsConstants */).GuildScheduledEventEntityTypes;
const env0_12 = (require(482) /* metro dependency 482: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_scheduled_events/useGuildHasLiveChannelNotice.tsx');
exports.useGuildHasLiveChannelNotice = useGuildHasLiveChannelNotice;
exports.useGuildLiveChannelNoticeInfo = useGuildLiveChannelNoticeInfo;
}
function useGuildHasLiveChannelNotice(a0) { // fn#110171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:368, offset: 0x0236d7c2, size: 263 bytes, params: 2, frame: 23
const value2 = undefined;
const value3 = (importDefault(14569) /* metro dependency 14569: useLiveStageChannels */)(a0);
const getChannel = ChannelStore.getChannel;
const property = value3[0];
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([StageInstanceStore], _fun110172,
[Reflect.apply(getChannel, ChannelStore, [property == null ? value2 : property.id])]);
const value6 = (require(9127) /* metro dependency 9127: useGuildScheduledEvents */).useGuildActiveEvent(a0);
const value = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([LiveChannelNoticesStore],
_fun110173, [value5, value6]);
const isStageNoticeHidden = value.isStageNoticeHidden;
return value6 != null ? value5 != null ? !isStageNoticeHidden : !value.isEventNoticeHidden : value5 != null && !isStageNoticeHidden;
}
function useGuildLiveChannelNoticeInfo(a0) { // fn#110174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:937, offset: 0x0236d966, size: 470 bytes, params: 2, frame: 25
const value2 = undefined;
const value3 = (require(14570) /* metro dependency 14570: useActiveEventOrStageInstanceChannel */).useActiveEventOrStageInstanceChannel(a0);
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun110175);
const value5 = (require(9127) /* metro dependency 9127: useGuildScheduledEvents */).useGuildActiveEvent(a0);
const value6 = (require(566) /* metro dependency 566: flux */).useStateFromStores([StageInstanceStore], _fun110176,
[value3]);
const stageChannelParticipantStoreHooksModule = require(6273) /* metro dependency 6273: StageChannelParticipantStoreHooks */;
const useActualStageSpeakerCount = stageChannelParticipantStoreHooksModule.useActualStageSpeakerCount;
const value8 = Reflect.apply(useActualStageSpeakerCount, stageChannelParticipantStoreHooksModule,
[value3 == null ? value2 : value3.id]) > 0;
const value9 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SortedVoiceStateStore],
_fun110177);
const value10 = false;
const r6 = value3 == null ? value3 != null && value5 != null ? value9 : value10 : value6 != null ? value8 : value3 != null && value5 != null ? value9 : value10;
const value13 = (require(566) /* metro dependency 566: flux */).useStateFromStores([StageChannelParticipantStore],
_fun110178, [value3]);
return value13.useMemo(_fun110180, [value4, value5 == null ? value2 : value5.entity_type, r6, value13,
(require(566) /* metro dependency 566: flux */).useStateFromStores([ApplicationStreamingStore], _fun110179)]);
}
function _fun110172() { // fn#110172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:507, offset: 0x0236d8c9, size: 47 bytes, params: 1, frame: 13
return StageInstanceStore.getStageInstanceByChannel(env0_0?.id);
}
function _fun110173() { // fn#110173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:641, offset: 0x0236d8f8, size: 110 bytes, params: 1, frame: 18
const object2 = {};
const value3 = undefined;
object2.isStageNoticeHidden = LiveChannelNoticesStore.isLiveChannelNoticeHidden({stageId: env0_1 == null ? value3 : env0_1.id});
object2.isEventNoticeHidden = LiveChannelNoticesStore.isLiveChannelNoticeHidden({eventId: env0_2 == null ? value3 : env0_2.id});
return object2;
}
function _fun110175() { // fn#110175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:1069, offset: 0x0236db3c, size: 51 bytes, params: 1, frame: 14
return env0_0 != null && PermissionStore.can(Permissions.CONNECT, env0_0);
}
function _fun110177() { // fn#110177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:1327, offset: 0x0236db6f, size: 51 bytes, params: 1, frame: 12
return env0_0 != null && SortedVoiceStateStore.getVoiceStatesForChannel(env0_0).length > 0;
}
function _fun110178() { // fn#110178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:1470, offset: 0x0236dba2, size: 86 bytes, params: 1, frame: 16
var r0;
var value3;
var value;
const value2 = env0_0 != null;
if (value2) {
value3 = environment.__proto__;
value = StageChannelParticipantStore.getParticipantCount(env0_0.id,
(require(6268) /* metro dependency 6268: StageChannelParticipants */).StageChannelParticipantNamedIndex.AUDIENCE);
value = value > 0;
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function _fun110179() { // fn#110179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:1606, offset: 0x0236dbf8, size: 56 bytes, params: 1, frame: 12
return env0_0 != null && ApplicationStreamingStore.getAllApplicationStreamsForChannel(env0_0.id).length > 0;
}
function _fun110180() { // fn#110180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14764:1722, offset: 0x0236dc30, size: 67 bytes, params: 1, frame: 4
const entity_typeBinding = entity_type;
const EXTERNAL = GuildScheduledEventEntityTypes.EXTERNAL;
return {hasButton: entity_typeBinding === EXTERNAL || env0_1, hasSpeakers: env0_2, hasAudience: env0_3,
hasStream: env0_4};
}