47 lines
1.7 KiB
TypeScript
47 lines
1.7 KiB
TypeScript
// Metro module 10531 (f10532).
|
|
import ChannelStore from "../../../stores/ChannelStore";
|
|
import GuildStore from "../../../stores/GuildStore";
|
|
import { useStateFromStores } from "../../../_bundle/Module589";
|
|
import { useIsConnectedToVoiceChannel } from "../../voice_chat/VoiceChatHooks";
|
|
import useIsActivitiesAvailableInShelf from "../../activities/useIsActivitiesAvailableInShelf";
|
|
import useIsPrivateChannelWithEnabledActivities from "../../activities/utils/useIsPrivateChannelWithEnabledActivities";
|
|
import useIsRemote from "../../game_console/hooks/useIsRemote";
|
|
export function useIsFiveButtonLayout(a0) {
|
|
let c18112_1;
|
|
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(a0));
|
|
let r20 = useIsConnectedToVoiceChannel(stateFromStores);
|
|
let r14 = stateFromStores?.guild_id;
|
|
if (r14 == null) {
|
|
r14 = null;
|
|
}
|
|
c18112_1 = r14;
|
|
let r24 = stateFromStores?.guild_id;
|
|
if (r24 == null) {
|
|
r24 = null;
|
|
}
|
|
const isActivitiesAvailableInShelf = useIsActivitiesAvailableInShelf(r24, stateFromStores?.id);
|
|
const afkChannelId = useStateFromStores([GuildStore], () => GuildStore.getGuild(c18112_1), [r14])?.afkChannelId;
|
|
let r39 = stateFromStores == null ? void 0 : stateFromStores.isGuildVoice();
|
|
if (r39 == null) {
|
|
r39 = false;
|
|
}
|
|
const isPrivateChannelWithEnabledActivities = useIsPrivateChannelWithEnabledActivities(stateFromStores?.id);
|
|
const isRemote = useIsRemote();
|
|
if (r20) {
|
|
r20 = isActivitiesAvailableInShelf;
|
|
}
|
|
if (r20) {
|
|
if (!r39) {
|
|
r39 = isPrivateChannelWithEnabledActivities;
|
|
}
|
|
r20 = r39;
|
|
}
|
|
if (r20) {
|
|
r20 = !isRemote;
|
|
}
|
|
if (r20) {
|
|
r20 = !(afkChannelId === a0);
|
|
}
|
|
return r20;
|
|
}
|