decord/source/modules/hub/useIsHubRealNamePromptShowing.tsx

66 lines
2.1 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 12207
// Function ID: 12208
2026-07-20 16:05:17 +00:00
// Name: useIsHubRealNamePromptShowing
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 12208, 1992, 1910, 1922, 676, 12209, 589, 12210, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 12207 (useIsHubRealNamePromptShowing)
2026-08-24 06:08:38 +00:00
import closure_3 from "noop" /* 19 */;
2026-08-25 06:04:03 +00:00
import closure_4 from "initialize" /* 12208 */;
import closure_5 from "trackCommunicationDisabled" /* 1992 */;
2026-08-24 06:08:38 +00:00
import closure_6 from "createGuildRecordFromRust" /* 1910 */;
import closure_7 from "mergeGuildAvatar" /* 1922 */;
import { GuildFeatures } from "ME" /* 676 */;
2026-08-25 06:04:03 +00:00
import { GuildPrompts } from "GuildPrompts" /* 12209 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/hub/useIsHubRealNamePromptShowing.tsx");
2026-07-20 16:05:17 +00:00
export default function useIsHubRealNamePromptShowing(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-08-24 06:08:38 +00:00
const items = [closure_6, closure_4, closure_7, closure_5];
2026-07-29 08:29:29 +00:00
const stateFromStores = _require(589).useStateFromStores(items, () => {
2026-08-24 06:08:38 +00:00
const guild = closure_1_6.getGuild(closure_0);
2026-07-20 16:05:17 +00:00
let hasItem;
2026-07-29 08:29:29 +00:00
if (guild != null) {
2026-07-20 16:05:17 +00:00
const features = guild.features;
2026-08-24 06:08:38 +00:00
hasItem = features.has(closure_1_8.HUB);
2026-07-20 16:05:17 +00:00
}
if (true !== hasItem) {
return null;
2026-08-24 06:08:38 +00:00
} else if (true === closure_1_4.hasViewedPrompt(closure_1_9.REAL_NAME_PROMPT, guild.id)) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-08-24 06:08:38 +00:00
const currentUser = closure_1_7.getCurrentUser();
2026-07-20 16:05:17 +00:00
if (null == currentUser) {
return null;
} else {
let id;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
id = currentUser.id;
}
2026-08-24 06:08:38 +00:00
const member = closure_1_5.getMember(guild.id, id);
2026-07-20 16:05:17 +00:00
let nick;
2026-07-29 08:29:29 +00:00
if (member != null) {
2026-07-20 16:05:17 +00:00
nick = member.nick;
}
return null == nick;
}
}
});
const items1 = [stateFromStores, arg0];
const effect = React.useEffect(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null != closure_0;
if (tmp2) {
tmp2 = null != stateFromStores;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
2026-07-20 16:05:17 +00:00
if (!stateFromStores) {
2026-08-24 06:08:38 +00:00
stateFromStores(closure_1_2[8]).viewPrompt(closure_1_9.REAL_NAME_PROMPT, closure_0);
const obj = stateFromStores(closure_1_2[8]);
2026-07-20 16:05:17 +00:00
}
}
}, items1);
return true === stateFromStores;
};