Files
discord-decomp/modules/channel/shouldShowVoiceChannelChangeConfirmation.tsx
T
2026-11-01 12:12:55 +02:00

24 lines
999 B
TypeScript

// Metro module 12420 (f12421).
import GameConsoleStore from "../game_console/GameConsoleStore";
import UnsyncedUserSettingsStore from "../user_settings/UnsyncedUserSettingsStore";
import AuthenticationStore from "../../stores/AuthenticationStore";
import GuildStore from "../../stores/GuildStore";
import VoiceStateStore from "../../stores/VoiceStateStore";
export function shouldShowVoiceChannelChangeConfirmation(a0) {
if (UnsyncedUserSettingsStore.disableVoiceChannelChangeAlert) {
return false;
}
const remoteSessionId = GameConsoleStore.getRemoteSessionId();
if (VoiceStateStore.getVoiceStateForSession(AuthenticationStore.getId(), remoteSessionId) != null) {
return false;
}
if (VoiceStateStore.isCurrentClientInVoiceChannel()) {
if (VoiceStateStore.isInChannel(a0.id)) {
return false;
}
const guild = GuildStore.getGuild(a0.getGuildId());
return guild?.afkChannelId == null || !VoiceStateStore.isInChannel(guild.afkChannelId);
}
return false;
}