decord/alpha/source/modules/guild_themes/GuildThemeAnalyticsUtils.tsx

45 lines
1.4 KiB
TypeScript
Raw Permalink Normal View History

2026-10-13 12:43:34 +00:00
// Module ID: 17508
// Function ID: 17509
// Name: GuildThemeAnalyticsUtils
2026-10-10 08:08:14 +00:00
// Dependencies: [2087, 2]
2026-07-20 16:05:17 +00:00
// Exports: collectGuildThemeAnalyticsMetadata
2026-10-13 12:43:34 +00:00
// Module 17508 (GuildThemeAnalyticsUtils)
2026-10-10 08:08:14 +00:00
import GuildStore from "GuildStore" /* 2087 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const result = size.fileFinishedImporting("modules/guild_themes/GuildThemeAnalyticsUtils.tsx");
2026-07-20 16:05:17 +00:00
export const collectGuildThemeAnalyticsMetadata = function collectGuildThemeAnalyticsMetadata(selectedGuildId) {
if (null == selectedGuildId) {
return null;
} else {
const guild = GuildStore.getGuild(selectedGuildId);
2026-07-20 16:05:17 +00:00
if (null == guild) {
return null;
} else {
const guildTheme = guild.guildTheme;
if (null != guildTheme) {
if (guildTheme.enabled) {
const themeSettings = guildTheme.themeSettings;
let prop;
2026-07-29 08:29:29 +00:00
if (themeSettings != null) {
2026-07-20 16:05:17 +00:00
prop = themeSettings.customUserThemeSettings;
}
const obj = { guild_theme_enabled: true, guild_theme_is_custom: null != prop };
2026-07-20 16:05:17 +00:00
const themeSettings2 = guildTheme.themeSettings;
let presetId;
2026-07-29 08:29:29 +00:00
if (themeSettings2 != null) {
2026-07-20 16:05:17 +00:00
presetId = themeSettings2.presetId;
}
if (null != presetId) {
obj.guild_theme_preset_id = presetId;
}
return obj;
}
}
2026-07-23 10:11:24 +00:00
return { guild_theme_enabled: false, guild_theme_is_custom: false };
2026-07-20 16:05:17 +00:00
}
}
};