2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 12150
|
|
|
|
|
// Function ID: 12151
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: WelcomeScreenUtils
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [19, 12151, 4467, 2067, 4666, 12152, 504, 12153, 4800, 12154, 1981, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: openWelcomeActionSheet, useShowWelcomeModal
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 12150 (WelcomeScreenUtils)
|
2026-10-01 14:13:23 +00:00
|
|
|
import asyncRequire from "asyncRequire" /* 1981 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import ActionSheetActionCreatorsDefault from "ActionSheetActionCreators" /* 4800 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import WelcomeScreenStore2 from "WelcomeScreenStore" /* 12151 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import WelcomeScreenActionCreators from "WelcomeScreenActionCreators" /* 12153 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import react_mod from "react" /* 19 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import GuildChannelStore from "GuildChannelStore" /* 4467 */;
|
|
|
|
|
import GuildStore from "GuildStore" /* 2067 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
|
|
|
|
const require = globalThis.__r;
|
2026-10-01 14:13:23 +00:00
|
|
|
const WelcomeScreenStore = WelcomeScreenStore2;
|
|
|
|
|
let _require, importDefault;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let react = react_mod;
|
|
|
|
|
const NO_WELCOME_SCREEN = WelcomeScreenStore2.NO_WELCOME_SCREEN;
|
|
|
|
|
let closure_8 = { welcomeScreenModalVisible: false, shouldFetchGuildId: "r" };
|
2026-09-18 19:45:33 +00:00
|
|
|
const result = size.fileFinishedImporting("utils/native/WelcomeScreenUtils.tsx");
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
export const useShowWelcomeModal = function useShowWelcomeModal(guildId, channelId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let closure_3;
|
|
|
|
|
let shouldFetchGuildId;
|
|
|
|
|
let welcomeModalChannelId;
|
2026-09-26 17:57:22 +00:00
|
|
|
_require = guildId;
|
|
|
|
|
importDefault = channelId;
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = require("MemoryRouter");
|
|
|
|
|
welcomeModalChannelId = obj.useLocation().welcomeModalChannelId;
|
|
|
|
|
react = require("useWelcomeScreenEnabled")(channelId, guildId);
|
2026-09-18 19:45:33 +00:00
|
|
|
const items = [GuildStore, shouldFetchGuildId, GuildChannelStore];
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj2 = require("get initialized");
|
|
|
|
|
const stateFromStoresObject = obj2.useStateFromStoresObject(items, () => {
|
|
|
|
|
let id;
|
|
|
|
|
const tmp = closure_3;
|
|
|
|
|
if (tmp) {
|
|
|
|
|
const guild = GuildStore.getGuild(guildId);
|
|
|
|
|
const selectableChannelIds = GuildChannelStore.getSelectableChannelIds(guildId);
|
|
|
|
|
const value = WelcomeScreenStore.get(guildId);
|
|
|
|
|
const hasSeenResult = WelcomeScreenStore.hasSeen(guildId);
|
|
|
|
|
let tmp12 = !hasSeenResult;
|
2026-09-18 19:45:33 +00:00
|
|
|
const hasErrorResult = WelcomeScreenStore.hasError();
|
2026-10-01 14:13:23 +00:00
|
|
|
const isFetchingResult = WelcomeScreenStore.isFetching();
|
2026-09-18 19:45:33 +00:00
|
|
|
if (!hasSeenResult) {
|
2026-10-01 14:13:23 +00:00
|
|
|
tmp12 = welcomeModalChannelId === channelId;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = { welcomeScreenModalVisible: tmp12 && null != value && value !== NO_WELCOME_SCREEN && !isFetchingResult && !hasErrorResult && selectableChannelIds.length > 0, shouldFetchGuildId: id };
|
|
|
|
|
id = undefined;
|
|
|
|
|
if (tmp12) {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null == value) {
|
|
|
|
|
if (null != guild) {
|
|
|
|
|
id = guild.id;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return obj;
|
|
|
|
|
} else {
|
|
|
|
|
return closure_8;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
shouldFetchGuildId = stateFromStoresObject.shouldFetchGuildId;
|
|
|
|
|
const items1 = [shouldFetchGuildId];
|
2026-10-01 14:13:23 +00:00
|
|
|
const welcomeScreenModalVisible = stateFromStoresObject.welcomeScreenModalVisible;
|
|
|
|
|
const effect = react.useEffect(() => {
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != shouldFetchGuildId) {
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = WelcomeScreenActionCreators;
|
|
|
|
|
const welcomeScreen = obj.fetchWelcomeScreen(tmp);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}, items1);
|
2026-10-01 14:13:23 +00:00
|
|
|
return welcomeScreenModalVisible;
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|
2026-10-01 14:13:23 +00:00
|
|
|
export const openWelcomeActionSheet = function openWelcomeActionSheet(guildId) {
|
|
|
|
|
guildId = guildId.guildId;
|
|
|
|
|
const onHide = guildId.onHide;
|
|
|
|
|
const openLazy = ActionSheetActionCreatorsDefault.openLazy;
|
|
|
|
|
ActionSheetActionCreatorsDefault;
|
|
|
|
|
const tmp2 = asyncRequire(12154, dependencyMap.paths);
|
|
|
|
|
openLazy(tmp2, "GuildWelcomeActionSheet" + guildId, { guildId, onHide });
|
2026-09-18 19:45:33 +00:00
|
|
|
};
|