decord/beta/source/modules/guild_templates/useTrackCreateGuildViewed.tsx
2026-10-07 22:43:51 +00:00

79 lines
2.9 KiB
TypeScript

// Module ID: 11404
// Function ID: 11405
// Name: useTrackCreateGuildViewed
// Dependencies: [19, 6829, 1085, 558, 576, 1252, 2]
// Module 11404 (useTrackCreateGuildViewed)
import Constants from "Constants" /* 1085 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1252 */;
import GuildTemplatesConstants from "GuildTemplatesConstants" /* 6829 */;
import react from "react" /* 19 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
const require = globalThis.__r;
let _require;
const GuildTemplateStates = GuildTemplatesConstants.GuildTemplateStates;
const AnalyticEvents = Constants.AnalyticEvents;
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? ((arg0) => {
let closure_0;
let first;
let tmp3;
_require = arg0;
let obj = require("react");
const cResult = obj.c(3);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [];
cResult[0] = items;
first = items;
} else {
first = cResult[0];
}
const obj2 = react;
const ref = react.useRef(first);
if (cResult[1] !== arg0) {
const fn = function s() {
const tmp2 = null != closure_0 && tmp.state !== GuildTemplateStates.RESOLVING;
if (tmp2) {
const current = ref.current;
const tmp4 = ref;
if (!current.includes(closure_0.code)) {
const current1 = tmp4.current;
current1.push(closure_0.code);
const obj3 = { guild_template_code: null, guild_template_name: null, guild_template_description: null, guild_template_guild_id: null };
({ code: obj2.guild_template_code, name: obj2.guild_template_name, description: obj2.guild_template_description, sourceGuildId: obj2.guild_template_guild_id } = closure_0);
const obj = AnalyticsUtilsDefault;
obj.track(AnalyticEvents.CREATE_GUILD_VIEWED, obj3);
}
}
};
cResult[1] = arg0;
cResult[2] = fn;
tmp3 = fn;
} else {
tmp3 = cResult[2];
}
const effect = obj2.useEffect(tmp3);
}) : ((arg0) => {
let closure_0 = arg0;
const ref = react.useRef([]);
const effect = react.useEffect(() => {
const tmp2 = null != closure_0 && tmp.state !== GuildTemplateStates.RESOLVING;
if (tmp2) {
const current = ref.current;
const tmp4 = ref;
if (!current.includes(closure_0.code)) {
const current1 = tmp4.current;
current1.push(closure_0.code);
const obj3 = { guild_template_code: null, guild_template_name: null, guild_template_description: null, guild_template_guild_id: null };
({ code: obj2.guild_template_code, name: obj2.guild_template_name, description: obj2.guild_template_description, sourceGuildId: obj2.guild_template_guild_id } = closure_0);
const obj = AnalyticsUtilsDefault;
obj.track(AnalyticEvents.CREATE_GUILD_VIEWED, obj3);
}
}
});
});
const result = size.fileFinishedImporting("modules/guild_templates/useTrackCreateGuildViewed.tsx");
export default tmp2;