decord/source/modules/guild_invite/native/InviteSettingsModal.tsx

179 lines
7.5 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 17290
// Function ID: 17291
2026-07-20 16:05:17 +00:00
// Name: AdvancedInstantInviteScreen
2026-08-27 16:17:25 +00:00
// Dependencies: [32, 19, 1391, 9830, 1910, 4089, 676, 21, 4445, 712, 1500, 589, 38, 12, 17291, 9835, 4809, 1236, 4897, 709, 6189, 8295, 17292, 9831, 503, 5447, 5960, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-27 16:17:25 +00:00
// Module 17290 (AdvancedInstantInviteScreen)
2026-08-24 06:08:38 +00:00
import ThemesDefault from "Themes" /* 712 */;
2026-08-27 16:17:25 +00:00
import NavigationStack from "NavigationStack" /* 5960 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
2026-08-27 16:17:25 +00:00
import closure_6 from "updateWithLatestInvite" /* 9830 */;
2026-08-24 06:08:38 +00:00
import closure_7 from "createGuildRecordFromRust" /* 1910 */;
2026-08-26 06:04:24 +00:00
import closure_8 from "getUncachedChannelPermissions" /* 4089 */;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
import { jsx } from "jsxProd" /* 21 */;
2026-08-27 16:17:25 +00:00
import createCacheKey from "createCacheKey" /* 4445 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-20 16:05:17 +00:00
function AdvancedInstantInviteScreen() {
2026-08-24 06:08:38 +00:00
let tmp = callback();
2026-08-15 05:55:55 +00:00
let obj = navigation(1500);
2026-07-23 10:11:24 +00:00
navigation = obj.useNavigation();
2026-08-24 06:08:38 +00:00
const items = [closure_5, closure_6, closure_7];
2026-07-29 08:29:29 +00:00
const stateFromStoresObject = navigation(589).useStateFromStoresObject(items, () => {
const pendingSettings = store.getPendingSettings();
2026-08-24 06:08:38 +00:00
channel(38)(null != pendingSettings, "Received null pending invite settings");
2026-07-29 08:29:29 +00:00
const inviteSettings = store.getInviteSettings();
2026-08-24 06:08:38 +00:00
channel(38)(null != inviteSettings, "Received null invite settings");
2026-07-29 08:29:29 +00:00
channel = channel.getChannel(pendingSettings.channelId);
2026-07-20 16:05:17 +00:00
let guildId;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guildId = channel.getGuildId();
}
2026-07-29 08:29:29 +00:00
return { settings: pendingSettings, inviteSettings, channel, guild: guild.getGuild(guildId) };
2026-07-20 16:05:17 +00:00
});
({ settings, channel } = stateFromStoresObject);
({ inviteSettings, guild } = stateFromStoresObject);
2026-07-29 08:29:29 +00:00
const tmp6 = callback(React.useState(channel), 2);
const first = tmp6[0];
let tmp8 = null != channel;
if (tmp8) {
tmp8 = channel !== first;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp8) {
tmp6[1](channel);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let tmp2Result = tmp2(12);
const tmp10 = !tmp2Result.isEqual(settings, inviteSettings);
2026-08-24 06:08:38 +00:00
dependencyMap = tmp10;
2026-07-20 16:05:17 +00:00
const items1 = [channel];
2026-07-29 08:29:29 +00:00
const effect = obj3.useEffect(() => {
2026-07-20 16:05:17 +00:00
if (null == channel) {
2026-08-24 06:08:38 +00:00
const guildId = closure_1_6.getGuildId();
2026-07-20 16:05:17 +00:00
let invitableChannelForGuild = null;
if (null != guildId) {
2026-08-27 16:17:25 +00:00
let obj = navigation(17291);
2026-07-20 16:05:17 +00:00
invitableChannelForGuild = obj.getInvitableChannelForGuild(guildId);
}
if (null != invitableChannelForGuild) {
2026-07-29 08:29:29 +00:00
obj = { channelId: null };
obj[0] = invitableChannelForGuild.channel.id;
2026-08-27 16:17:25 +00:00
channel(9835).updateSettings(obj);
const obj2 = channel(9835);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj = { title: null, body: null, onConfirm: null };
2026-08-24 06:08:38 +00:00
const intl = navigation(1236).intl;
obj[0] = intl.string(navigation(1236).t.VINpSK);
const intl2 = navigation(1236).intl;
obj[1] = intl2.string(navigation(1236).t.kQ6fit);
2026-08-27 16:17:25 +00:00
obj[2] = channel(9835).close;
channel(4809).show(obj);
const obj4 = channel(4809);
2026-07-20 16:05:17 +00:00
}
}
}, items1);
2026-08-27 16:17:25 +00:00
tmp2Result = tmp2(4897);
2026-07-29 08:29:29 +00:00
const unmountEffect = tmp2Result.useUnmountEffect(() => {
2026-08-27 16:17:25 +00:00
channel(709).wait(channel(9835).resetSettings);
2026-07-20 16:05:17 +00:00
});
const items2 = [channel];
2026-07-29 08:29:29 +00:00
callback = obj3.useCallback(() => {
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-08-24 06:08:38 +00:00
if (closure_1_8.can(closure_1_10.CREATE_INSTANT_INVITE, tmp)) {
2026-08-27 16:17:25 +00:00
const invite = channel(9835).createInvite("IOS Regenerate");
const obj3 = channel(9835);
channel(9835).close();
const obj4 = channel(9835);
2026-07-20 16:05:17 +00:00
}
}
2026-08-27 16:17:25 +00:00
let obj = channel(4809);
2026-07-29 08:29:29 +00:00
obj = { title: null, body: null, onConfirm: null };
2026-08-24 06:08:38 +00:00
const intl = navigation(1236).intl;
obj[0] = intl.string(navigation(1236).t.VINpSK);
const intl2 = navigation(1236).intl;
obj[1] = intl2.string(navigation(1236).t.RiiKV0);
2026-08-27 16:17:25 +00:00
obj[2] = channel(9835).close;
2026-07-20 16:05:17 +00:00
obj.show(obj);
}, items2);
2026-07-29 08:29:29 +00:00
const items3 = [navigation, tmp10, callback];
const effect1 = obj3.useEffect(() => {
2026-07-20 16:05:17 +00:00
navigation.setOptions({
headerRight() {
let tmp;
2026-07-29 08:29:29 +00:00
if (closure_2) {
const obj = { onPress: null, text: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_3;
const intl = closure_1_0(closure_1_2[17]).intl;
obj[1] = intl.string(closure_1_0(closure_1_2[17]).t["R3BPH+"]);
tmp = closure_1_11(closure_1_0(closure_1_2[20]).HeaderActionButton, obj);
2026-07-20 16:05:17 +00:00
}
return tmp;
}
});
}, items3);
2026-07-29 08:29:29 +00:00
const callback1 = obj3.useCallback((maxUses) => {
2026-08-27 16:17:25 +00:00
let obj = channel(9835);
2026-07-20 16:05:17 +00:00
obj = { maxUses };
obj.updateSettings(obj);
}, []);
2026-07-29 08:29:29 +00:00
const callback2 = obj3.useCallback((maxAge) => {
2026-08-27 16:17:25 +00:00
let obj = channel(9835);
2026-07-20 16:05:17 +00:00
obj = { maxAge };
obj.updateSettings(obj);
}, []);
2026-07-29 08:29:29 +00:00
const callback3 = obj3.useCallback((temporary) => {
2026-08-27 16:17:25 +00:00
let obj = channel(9835);
2026-07-20 16:05:17 +00:00
obj = { temporary };
obj.updateSettings(obj);
}, []);
2026-07-29 08:29:29 +00:00
const callback4 = obj3.useCallback((flags) => {
2026-08-27 16:17:25 +00:00
let obj = channel(9835);
2026-07-20 16:05:17 +00:00
obj = { flags };
obj.updateSettings(obj);
}, []);
2026-07-29 08:29:29 +00:00
const callback5 = obj3.useCallback((roleIds) => {
2026-08-27 16:17:25 +00:00
let obj = channel(9835);
2026-07-20 16:05:17 +00:00
obj = { roleIds };
obj.updateSettings(obj);
}, []);
2026-07-29 08:29:29 +00:00
obj = { contentContainerStyle: tmp.formContainer, children: null };
obj = { style: tmp.formContent, channel: first, guild, maxAge: settings.maxAge, maxUses: settings.maxUses, maxUsesOptions: null, temporary: null, flags: null, roleIds: null, onChangeMaxAge: null, onChangeMaxUses: null, onChangeTemporary: null, onChangeFlags: null, onChangeRoleIds: null };
let obj2 = navigation(589);
2026-08-27 16:17:25 +00:00
obj[5] = channel(9831).getMaxUsesOptions;
2026-07-29 08:29:29 +00:00
({ temporary: obj7[6], flags: obj7[7], roleIds: obj7[8] } = settings);
obj[9] = callback2;
obj[10] = callback1;
obj[11] = callback3;
obj[12] = callback4;
obj[13] = callback5;
2026-08-27 16:17:25 +00:00
obj[1] = jsx(channel(17292), { style: tmp.formContent, channel: first, guild, maxAge: settings.maxAge, maxUses: settings.maxUses, maxUsesOptions: null, temporary: null, flags: null, roleIds: null, onChangeMaxAge: null, onChangeMaxUses: null, onChangeTemporary: null, onChangeFlags: null, onChangeRoleIds: null });
return jsx(navigation(8295).Form, { style: tmp.formContent, channel: first, guild, maxAge: settings.maxAge, maxUses: settings.maxUses, maxUsesOptions: null, temporary: null, flags: null, roleIds: null, onChangeMaxAge: null, onChangeMaxUses: null, onChangeTemporary: null, onChangeFlags: null, onChangeRoleIds: null });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ InviteModalScenes: c9, Permissions: c10 } = ME);
createCacheKey = { formContainer: null, formContent: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { paddingTop: ThemesDefault.space.PX_16, paddingBottom: ThemesDefault.space.PX_32 };
2026-07-29 08:29:29 +00:00
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { paddingHorizontal: ThemesDefault.modules.mobile.TABLE_ROW_PADDING };
let closure_12 = createCacheKey.createStyles(createCacheKey);
const obj1 = { paddingHorizontal: ThemesDefault.modules.mobile.TABLE_ROW_PADDING };
const result = require("set").fileFinishedImporting("modules/guild_invite/native/InviteSettingsModal.tsx");
2026-07-20 16:05:17 +00:00
export default function InviteSettingsModal() {
2026-07-29 08:29:29 +00:00
const memo = React.useMemo(() => {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-29 08:29:29 +00:00
obj = { impressionName: callback(503).ImpressionNames.GUILD_INVITE_LINK_SETTINGS, title: null, headerLeft: null, render: null };
const intl = callback(1236).intl;
obj[1] = intl.string(callback(1236).t.Yx4IiC);
2026-08-27 16:17:25 +00:00
obj[2] = callback(5447).getHeaderCloseButton(callback2(9835).close);
2026-07-29 08:29:29 +00:00
obj[3] = function render() {
return callback(closure_13, {});
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[constants.ADVANCED] = obj;
2026-07-20 16:05:17 +00:00
return obj;
2026-07-29 08:29:29 +00:00
}, []);
2026-08-24 06:08:38 +00:00
return jsx(NavigationStack.Navigator, { screens: memo, initialRouteName: constants.ADVANCED });
2026-07-20 16:05:17 +00:00
};