decord/source/utils/native/WelcomeScreenUtils.tsx

85 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 12415
// Function ID: 12416
2026-07-20 16:05:17 +00:00
// Name: useShowWelcomeModal
2026-09-02 09:53:35 +00:00
// Dependencies: [19, 12416, 1981, 1908, 4310, 12417, 586, 12418, 4445, 12419, 2008, 2]
2026-07-20 16:05:17 +00:00
// Exports: openWelcomeActionSheet, useShowWelcomeModal
2026-09-02 09:53:35 +00:00
// Module 12415 (useShowWelcomeModal)
import asyncRequireImpl from "asyncRequireImpl" /* 2008 */;
2026-09-01 10:26:29 +00:00
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4445 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-09-02 09:53:35 +00:00
import closure_4 from "handleInviteData" /* 12416 */;
import { NO_WELCOME_SCREEN } from "handleInviteData" /* 12416 */;
import closure_6 from "comparator" /* 1981 */;
import closure_7 from "createGuildRecordFromRust" /* 1908 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-09-01 10:26:29 +00:00
let closure_8 = { welcomeScreenModalVisible: false, shouldFetchGuildId: "r" };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("utils/native/WelcomeScreenUtils.tsx");
2026-07-20 16:05:17 +00:00
export const useShowWelcomeModal = function useShowWelcomeModal(guildId, channelId) {
2026-07-23 10:11:24 +00:00
const _require = guildId;
2026-08-24 06:08:38 +00:00
importDefault = channelId;
2026-07-23 10:11:24 +00:00
welcomeModalChannelId = _require(welcomeModalChannelId[4]).useLocation().welcomeModalChannelId;
const React = importDefault(welcomeModalChannelId[5])(channelId, guildId);
let obj = _require(welcomeModalChannelId[4]);
2026-08-24 06:08:38 +00:00
const items = [closure_7, shouldFetchGuildId, closure_6];
2026-07-23 10:11:24 +00:00
const stateFromStoresObject = _require(welcomeModalChannelId[6]).useStateFromStoresObject(items, () => {
2026-08-24 06:08:38 +00:00
if (closure_3) {
const guild = closure_1_7.getGuild(closure_0);
const selectableChannelIds = closure_1_6.getSelectableChannelIds(closure_0);
2026-07-23 10:11:24 +00:00
const value = shouldFetchGuildId.get(closure_0);
const hasSeenResult = shouldFetchGuildId.hasSeen(closure_0);
2026-07-20 16:05:17 +00:00
let tmp11 = !hasSeenResult;
const hasErrorResult = shouldFetchGuildId.hasError();
2026-07-29 08:29:29 +00:00
if (!hasSeenResult) {
2026-07-23 10:11:24 +00:00
tmp11 = welcomeModalChannelId === closure_1;
2026-07-20 16:05:17 +00:00
}
let tmp14 = tmp11;
if (tmp11) {
tmp14 = null != value;
}
if (tmp14) {
2026-08-24 06:08:38 +00:00
tmp14 = value !== closure_1_5;
2026-07-20 16:05:17 +00:00
}
if (tmp14) {
tmp14 = !isFetchingResult;
}
if (tmp14) {
tmp14 = !hasErrorResult;
}
if (tmp14) {
tmp14 = selectableChannelIds.length > 0;
}
2026-07-29 08:29:29 +00:00
const obj = { welcomeScreenModalVisible: null, shouldFetchGuildId: null };
obj[0] = tmp14;
2026-07-20 16:05:17 +00:00
let id;
if (tmp11) {
if (null == value) {
if (null != guild) {
id = guild.id;
}
}
}
2026-07-29 08:29:29 +00:00
obj[1] = id;
2026-07-20 16:05:17 +00:00
return obj;
} else {
2026-08-24 06:08:38 +00:00
return closure_1_8;
2026-07-20 16:05:17 +00:00
}
});
2026-07-23 10:11:24 +00:00
shouldFetchGuildId = stateFromStoresObject.shouldFetchGuildId;
2026-07-20 16:05:17 +00:00
const items1 = [shouldFetchGuildId];
const effect = React.useEffect(() => {
if (null != shouldFetchGuildId) {
2026-07-29 08:29:29 +00:00
const welcomeScreen = guildId(welcomeModalChannelId[7]).fetchWelcomeScreen(tmp);
2026-07-23 10:11:24 +00:00
const obj = guildId(welcomeModalChannelId[7]);
2026-07-20 16:05:17 +00:00
}
}, items1);
return stateFromStoresObject.welcomeScreenModalVisible;
};
export const openWelcomeActionSheet = function openWelcomeActionSheet(onHide) {
const guildId = onHide.guildId;
2026-08-24 06:08:38 +00:00
const obj = ACTION_SHEET_HEIGHT_HALFDefault;
2026-09-02 09:53:35 +00:00
obj.openLazy(asyncRequireImpl(12419, dependencyMap.paths), "GuildWelcomeActionSheet" + guildId, { guildId, onHide: onHide.onHide });
2026-07-20 16:05:17 +00:00
};