// Metro module 14967 (f14968). import SelectedChannelStore from "../../../../stores/SelectedChannelStore"; import SelectedGuildStore from "../../../../stores/SelectedGuildStore"; import { ME } from "../../../../Constants"; import { getRootNavigationRef } from "../../../main_tabs_v2/RootNavigationRef.native"; import { coerceGuildsRoute } from "../../../main_tabs_v2/helpers/NavigationRouteUtils.native"; import { transitionToChannel } from "../../../routing/transitionToChannel"; import { transitionToGuild } from "../../../routing/transitionToGuild.native"; export default function transitionGuildsBarToGuildOrOpenSelectedChannel(a0) { const rootNavigationRef = getRootNavigationRef(); const r14 = rootNavigationRef == null ? void 0 : rootNavigationRef.isReady(); let r17 = void 0; if (r14 === true) { const r21 = coerceGuildsRoute(rootNavigationRef.getCurrentRoute()); const r22 = r21 == null ? void 0 : r21.params?.drawerOpen; r17 = void 0; if (r22 !== true) { const r26 = a0 !== ME ? a0 : null; let r29 = SelectedGuildStore.getGuildId(); if (r29 == null) { r29 = null; } let r30 = void 0; if (r29 === r26) { let r34 = SelectedChannelStore.getChannelId(a0, false); if (r34 == null) { r34 = void 0; } r30 = r34; } r17 = r30; } } if (r17 != null) { transitionToChannel(r17); } else { transitionToGuild(a0); } };