decord/source/utils/native/WelcomeScreenUtils.tsx

83 lines
3 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 11747
// Function ID: 11748
2026-07-20 16:05:17 +00:00
// Name: useShowWelcomeModal
2026-07-29 08:29:29 +00:00
// Dependencies: [19, 11748, 1932, 1862, 4017, 11749, 589, 11750, 4157, 11751, 1959, 2]
2026-07-20 16:05:17 +00:00
// Exports: openWelcomeActionSheet, useShowWelcomeModal
2026-07-29 08:29:29 +00:00
// Module 11747 (useShowWelcomeModal)
import noop from "noop";
import handleInviteData from "handleInviteData";
import { NO_WELCOME_SCREEN } from "handleInviteData";
import comparator from "comparator";
import createGuildRecordFromRust from "createGuildRecordFromRust";
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let closure_8 = { welcomeScreenModalVisible: false, shouldFetchGuildId: "r" };
const result = require("comparator").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-07-20 16:05:17 +00:00
const 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-07-29 08:29:29 +00:00
const items = [createGuildRecordFromRust, shouldFetchGuildId, comparator];
2026-07-23 10:11:24 +00:00
const stateFromStoresObject = _require(welcomeModalChannelId[6]).useStateFromStoresObject(items, () => {
2026-07-29 08:29:29 +00:00
if (noop) {
2026-07-23 10:11:24 +00:00
const guild = outer1_7.getGuild(closure_0);
const selectableChannelIds = outer1_6.getSelectableChannelIds(closure_0);
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-07-23 10:11:24 +00:00
tmp14 = value !== outer1_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-07-23 10:11:24 +00:00
return outer1_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-07-29 08:29:29 +00:00
const obj = importDefault(4157);
obj.openLazy(require(1959) /* asyncRequireImpl */(11751, dependencyMap.paths), "GuildWelcomeActionSheet" + guildId, { guildId, onHide: onHide.onHide });
2026-07-20 16:05:17 +00:00
};