44 lines
1.4 KiB
TypeScript
44 lines
1.4 KiB
TypeScript
// Module ID: 16566
|
|
// Function ID: 16567
|
|
// Name: GuildThemeAnalyticsUtils
|
|
// Dependencies: [2073, 2]
|
|
// Exports: collectGuildThemeAnalyticsMetadata
|
|
|
|
// Module 16566 (GuildThemeAnalyticsUtils)
|
|
import GuildStore from "GuildStore" /* 2073 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
const result = size.fileFinishedImporting("modules/guild_themes/GuildThemeAnalyticsUtils.tsx");
|
|
|
|
export const collectGuildThemeAnalyticsMetadata = function collectGuildThemeAnalyticsMetadata(selectedGuildId) {
|
|
if (null == selectedGuildId) {
|
|
return null;
|
|
} else {
|
|
const guild = GuildStore.getGuild(selectedGuildId);
|
|
if (null == guild) {
|
|
return null;
|
|
} else {
|
|
const guildTheme = guild.guildTheme;
|
|
if (null != guildTheme) {
|
|
if (guildTheme.enabled) {
|
|
const themeSettings = guildTheme.themeSettings;
|
|
let prop;
|
|
if (themeSettings != null) {
|
|
prop = themeSettings.customUserThemeSettings;
|
|
}
|
|
const obj = { guild_theme_enabled: true, guild_theme_is_custom: null != prop };
|
|
const themeSettings2 = guildTheme.themeSettings;
|
|
let presetId;
|
|
if (themeSettings2 != null) {
|
|
presetId = themeSettings2.presetId;
|
|
}
|
|
if (null != presetId) {
|
|
obj.guild_theme_preset_id = presetId;
|
|
}
|
|
return obj;
|
|
}
|
|
}
|
|
return { guild_theme_enabled: false, guild_theme_is_custom: false };
|
|
}
|
|
}
|
|
};
|