2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 4848
|
|
|
|
|
// Function ID: 4849
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: useGuildIdForChannelRoute
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [2048, 4655, 1074, 504, 2070, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: default, getGuildIdForGenericRedirect
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 4848 (useGuildIdForChannelRoute)
|
2026-10-01 14:13:23 +00:00
|
|
|
import get_initialized from "get initialized" /* 504 */;
|
|
|
|
|
import Constants from "Constants" /* 1074 */;
|
|
|
|
|
import FavoritesUtils from "FavoritesUtils" /* 2070 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import FavoriteStore from "FavoriteStore" /* 2048 */;
|
|
|
|
|
import SelectedGuildStore from "SelectedGuildStore" /* 4655 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
const FAVORITES = Constants.FAVORITES;
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("modules/routing/useGuildIdForChannelRoute.tsx");
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
export default function useGuildIdForChannelRoute(getGuildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let guildId;
|
2026-09-18 19:45:33 +00:00
|
|
|
const items = [SelectedGuildStore];
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = get_initialized;
|
|
|
|
|
let stateFromStores = obj.useStateFromStores(items, () => guildId.getGuildId());
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == stateFromStores) {
|
|
|
|
|
stateFromStores = getGuildId.getGuildId();
|
|
|
|
|
}
|
|
|
|
|
return stateFromStores;
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
2026-09-18 19:45:33 +00:00
|
|
|
export const getGuildIdForGenericRedirect = function getGuildIdForGenericRedirect(channel) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let guildId;
|
|
|
|
|
const obj = FavoritesUtils;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (!obj.isFavoritesGuildId(SelectedGuildStore.getGuildId())) {
|
2026-10-01 14:13:23 +00:00
|
|
|
guildId = channel.getGuildId();
|
2026-09-18 19:45:33 +00:00
|
|
|
} else if (FavoriteStore.isFavorite(channel.id)) {
|
|
|
|
|
guildId = FAVORITES;
|
|
|
|
|
}
|
|
|
|
|
return guildId;
|
|
|
|
|
};
|