20 lines
806 B
TypeScript
20 lines
806 B
TypeScript
// Metro module 10987 (f10988).
|
|
import { useRef, useEffect } from "react";
|
|
import { GuildTemplateStates } from "./GuildTemplatesConstants";
|
|
import { AnalyticEvents } from "../../Constants";
|
|
import AnalyticsUtils from "../../utils/AnalyticsUtils";
|
|
export default function useTrackCreateGuildViewed(c18433_0) {
|
|
const ref = useRef([]);
|
|
useEffect(() => {
|
|
if (c18433_0 != null && c18433_0.state !== GuildTemplateStates.RESOLVING && !ref.current.includes(c18433_0.code)) {
|
|
ref.current.push(c18433_0.code);
|
|
AnalyticsUtils.track(AnalyticEvents.CREATE_GUILD_VIEWED, {
|
|
guild_template_code: c18433_0.code,
|
|
guild_template_name: c18433_0.name,
|
|
guild_template_description: c18433_0.description,
|
|
guild_template_guild_id: c18433_0.sourceGuildId
|
|
});
|
|
}
|
|
});
|
|
};
|