decord/alpha/source/modules/hub/useIsHubRealNamePromptShowing.tsx

171 lines
5 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 13054
// Function ID: 13055
2026-07-20 16:05:17 +00:00
// Name: useIsHubRealNamePromptShowing
2026-10-13 12:43:34 +00:00
// Dependencies: [19, 13055, 2125, 2087, 1390, 1085, 13056, 558, 576, 504, 13057, 2]
2026-07-20 16:05:17 +00:00
2026-10-13 12:43:34 +00:00
// Module 13054 (useIsHubRealNamePromptShowing)
2026-10-03 08:58:59 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-13 12:43:34 +00:00
import Constants2 from "Constants" /* 13056 */;
import GuildPromptsActionCreatorsDefault from "GuildPromptsActionCreators" /* 13057 */;
2026-10-03 08:58:59 +00:00
import react from "react" /* 19 */;
2026-10-13 12:43:34 +00:00
import GuildPromptsStore from "GuildPromptsStore" /* 13055 */;
2026-10-10 08:08:14 +00:00
import GuildMemberStore from "GuildMemberStore" /* 2125 */;
import GuildStore from "GuildStore" /* 2087 */;
2026-10-09 10:00:15 +00:00
import UserStore from "UserStore" /* 1390 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
2026-10-03 08:58:59 +00:00
let _require;
2026-10-03 08:58:59 +00:00
const GuildFeatures = Constants.GuildFeatures;
const GuildPrompts = Constants2.GuildPrompts;
2026-10-08 09:57:35 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useIsHubRealNamePromptShowing(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0;
let first;
let tmp9;
_require = arg0;
2026-10-03 08:58:59 +00:00
let tmp = _require;
let tmp2 = dependencyMap;
let obj = require("react");
const cResult = obj.c(7);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [GuildStore, , , ];
items[1] = GuildPromptsStore;
items[2] = UserStore;
items[3] = GuildMemberStore;
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
if (cResult[1] !== arg0) {
const fn = function _() {
const guild = GuildStore.getGuild(closure_0);
let hasItem;
if (guild != null) {
const features = guild.features;
hasItem = features.has(GuildFeatures.HUB);
}
if (true !== hasItem) {
return null;
} else if (true === GuildPromptsStore.hasViewedPrompt(GuildPrompts.REAL_NAME_PROMPT, guild.id)) {
return null;
} else {
const currentUser = UserStore.getCurrentUser();
if (null == currentUser) {
return null;
} else {
let id1;
const getMember = GuildMemberStore.getMember;
const id = guild.id;
if (currentUser != null) {
id1 = currentUser.id;
}
const member = getMember(id, id1);
let nick;
if (member != null) {
nick = member.nick;
}
return null == nick;
}
}
};
cResult[1] = arg0;
cResult[2] = fn;
tmp9 = fn;
} else {
tmp9 = cResult[2];
}
const tmpResult = tmp(504);
const stateFromStores = tmpResult.useStateFromStores(first, tmp9);
if (cResult[3] === arg0) {
let tmp11;
let tmp12;
if (cResult[4] === stateFromStores) {
tmp11 = cResult[5];
tmp12 = cResult[6];
}
const effect = react.useEffect(tmp11, tmp12);
return true === stateFromStores;
}
2026-10-08 09:57:35 +00:00
class R {
2026-10-03 08:58:59 +00:00
constructor() {
let tmp2 = null != closure_0;
const tmp = closure_0;
if (tmp2) {
tmp2 = null != stateFromStores;
}
if (tmp2) {
const tmp4 = stateFromStores;
if (!tmp4) {
const obj = GuildPromptsActionCreatorsDefault;
obj.viewPrompt(GuildPrompts.REAL_NAME_PROMPT, tmp);
}
}
}
}
const items1 = [stateFromStores, arg0];
cResult[3] = arg0;
cResult[4] = stateFromStores;
2026-10-08 09:57:35 +00:00
cResult[5] = R;
2026-10-03 08:58:59 +00:00
cResult[6] = items1;
tmp12 = items1;
2026-10-08 09:57:35 +00:00
tmp11 = R;
}) : (function useIsHubRealNamePromptShowing(arg0) {
2026-10-03 08:58:59 +00:00
let closure_0;
_require = arg0;
let obj = require("get initialized");
const items = [GuildStore, GuildPromptsStore, UserStore, GuildMemberStore];
2026-10-03 08:58:59 +00:00
const stateFromStores = obj.useStateFromStores(items, () => {
const guild = GuildStore.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;
hasItem = features.has(GuildFeatures.HUB);
2026-07-20 16:05:17 +00:00
}
if (true !== hasItem) {
return null;
} else if (true === GuildPromptsStore.hasViewedPrompt(GuildPrompts.REAL_NAME_PROMPT, guild.id)) {
2026-07-20 16:05:17 +00:00
return null;
} else {
const currentUser = UserStore.getCurrentUser();
2026-07-20 16:05:17 +00:00
if (null == currentUser) {
return null;
} else {
2026-10-03 08:58:59 +00:00
let id1;
const getMember = GuildMemberStore.getMember;
const id = guild.id;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-10-03 08:58:59 +00:00
id1 = currentUser.id;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const member = getMember(id, id1);
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];
2026-10-03 08:58:59 +00:00
const effect = react.useEffect(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null != closure_0;
2026-10-03 08:58:59 +00:00
const tmp = closure_0;
2026-07-29 08:29:29 +00:00
if (tmp2) {
tmp2 = null != stateFromStores;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp2) {
2026-10-03 08:58:59 +00:00
const tmp4 = stateFromStores;
if (!tmp4) {
const obj = GuildPromptsActionCreatorsDefault;
obj.viewPrompt(GuildPrompts.REAL_NAME_PROMPT, tmp);
2026-07-20 16:05:17 +00:00
}
}
}, items1);
return true === stateFromStores;
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("modules/hub/useIsHubRealNamePromptShowing.tsx");
export default tmp2;