// Module ID: 5104 // Function ID: 5105 // Name: useGuildIdForChannelRoute // Dependencies: [2068, 4939, 1085, 558, 576, 504, 2090, 2] // Exports: getGuildIdForGenericRedirect // Module 5104 (useGuildIdForChannelRoute) import react from "react" /* 576 */; import Constants from "Constants" /* 1085 */; import FavoritesUtils from "FavoritesUtils" /* 2090 */; import FavoriteStore from "FavoriteStore" /* 2068 */; import SelectedGuildStore from "SelectedGuildStore" /* 4939 */; import ReactCompilerGating from "ReactCompilerGating" /* 558 */; import size from "module_2" /* 2 */; let tmp; const get_initialized = tmp(504); const FAVORITES = Constants.FAVORITES; const tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useGuildIdForChannelRoute(getGuildId) { let tmp4; let tmp5; const obj = react; const cResult = obj.c(4); if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) { const items = [SelectedGuildStore]; const fn = function l() { return guildId.getGuildId(); }; cResult[0] = items; cResult[1] = fn; tmp4 = items; tmp5 = fn; } else { [tmp4, tmp5] = cResult; } const tmpResult = get_initialized; let stateFromStores = tmpResult.useStateFromStores(tmp4, tmp5); if (null == stateFromStores) { let tmp9; if (cResult[2] !== getGuildId) { const guildId = getGuildId.getGuildId(); cResult[2] = getGuildId; cResult[3] = guildId; tmp9 = guildId; } else { tmp9 = cResult[3]; } stateFromStores = tmp9; } return stateFromStores; }) : (function useGuildIdForChannelRoute(getGuildId) { let guildId; const items = [SelectedGuildStore]; const obj = get_initialized; let stateFromStores = obj.useStateFromStores(items, () => guildId.getGuildId()); if (null == stateFromStores) { stateFromStores = getGuildId.getGuildId(); } return stateFromStores; }); const result = size.fileFinishedImporting("modules/routing/useGuildIdForChannelRoute.tsx"); export default tmp2; export const getGuildIdForGenericRedirect = function getGuildIdForGenericRedirect(channel) { let guildId; const obj = FavoritesUtils; if (!obj.isFavoritesGuildId(SelectedGuildStore.getGuildId())) { guildId = channel.getGuildId(); } else if (FavoriteStore.isFavorite(channel.id)) { guildId = FAVORITES; } return guildId; };