decord/beta/source/modules/guild_templates/useTrackCreateGuildViewed.tsx

80 lines
3 KiB
TypeScript
Raw Permalink Normal View History

2026-10-12 16:32:48 +00:00
// Module ID: 11348
// Function ID: 11349
// Name: useTrackCreateGuildViewed
2026-10-12 16:32:48 +00:00
// Dependencies: [19, 7031, 1085, 558, 576, 1265, 2]
2026-10-12 16:32:48 +00:00
// Module 11348 (useTrackCreateGuildViewed)
2026-10-07 22:43:51 +00:00
import Constants from "Constants" /* 1085 */;
2026-10-12 16:32:48 +00:00
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1265 */;
import GuildTemplatesConstants from "GuildTemplatesConstants" /* 7031 */;
2026-10-01 14:13:23 +00:00
import react from "react" /* 19 */;
2026-10-02 13:37:24 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
2026-10-02 13:37:24 +00:00
const require = globalThis.__r;
let _require;
2026-10-01 14:13:23 +00:00
const GuildTemplateStates = GuildTemplatesConstants.GuildTemplateStates;
const AnalyticEvents = Constants.AnalyticEvents;
2026-10-12 16:32:48 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useTrackCreateGuildViewed(arg0) {
2026-10-02 13:37:24 +00:00
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) {
2026-10-12 16:32:48 +00:00
const fn = function _() {
2026-10-02 13:37:24 +00:00
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);
2026-10-12 16:32:48 +00:00
}) : (function useTrackCreateGuildViewed(arg0) {
2026-10-01 14:13:23 +00:00
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;
2026-10-01 14:13:23 +00:00
const tmp4 = ref;
if (!current.includes(closure_0.code)) {
const current1 = tmp4.current;
2026-10-01 14:13:23 +00:00
current1.push(closure_0.code);
const obj3 = { guild_template_code: null, guild_template_name: null, guild_template_description: null, guild_template_guild_id: null };
2026-10-01 14:13:23 +00:00
({ 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);
}
}
});
2026-10-02 13:37:24 +00:00
});
const result = size.fileFinishedImporting("modules/guild_templates/useTrackCreateGuildViewed.tsx");
export default tmp2;