decord/beta/source/modules/themes/resolveTheme.native.tsx
2026-10-01 14:13:23 +00:00

81 lines
3.3 KiB
TypeScript

// Module ID: 1226
// Function ID: 1227
// Name: resolveTheme
// Dependencies: [1227, 1183, 1184, 1220, 1185, 7081, 1228, 1186, 2]
// Exports: default
// Module 1226 (resolveTheme)
import preloaded_user_settings from "preloaded_user_settings" /* 1186 */;
import ClientThemesUtils from "ClientThemesUtils" /* 1228 */;
import AuthenticationUtils from "AuthenticationUtils" /* 7081 */;
import CustomThemeMobileStore from "CustomThemeMobileStore" /* 1227 */;
import SelectivelySyncedUserSettingsStore from "SelectivelySyncedUserSettingsStore" /* 1183 */;
import UnsyncedUserSettingsStore from "UnsyncedUserSettingsStore" /* 1184 */;
import UserSettingsProtoStore from "UserSettingsProtoStore" /* 1220 */;
import ThemeConstants from "ThemeConstants" /* 1185 */;
import size from "module_2" /* 2 */;
let metroImportAll;
let metroImportDefault;
let metroRequire;
({ PROTO_THEME_MAP_MOBILE_REFRESH: metroRequire, SystemTheme: metroImportDefault, SystemThemeState: metroImportAll } = ThemeConstants);
const result = size.fileFinishedImporting("modules/themes/resolveTheme.native.tsx");
export default function resolveTheme(arg0, arg1) {
const previewTheme = CustomThemeMobileStore.getPreviewTheme();
const obj = CustomThemeMobileStore;
if (undefined !== previewTheme) {
return previewTheme.baseTheme;
} else {
let customUserThemeSettings;
const useSystemTheme = UnsyncedUserSettingsStore.useSystemTheme;
const obj6 = AuthenticationUtils;
if (!obj6.isAuthenticated()) {
if (arg0 !== metroImportDefault.NO_PREFERENCE) {
const tmp17Result = ClientThemesUtils;
return tmp17Result.resolveThemeWithCustomSettings(arg1[arg0], obj.getCustomTheme());
}
}
const appearanceSettings = SelectivelySyncedUserSettingsStore.getAppearanceSettings();
let theme;
if (appearanceSettings != null) {
theme = appearanceSettings.theme;
}
const appearance = UserSettingsProtoStore.settings.appearance;
if (null != appearanceSettings) {
const clientThemeSettings2 = appearanceSettings.clientThemeSettings;
let prop;
if (clientThemeSettings2 != null) {
prop = clientThemeSettings2.customUserThemeSettings;
}
customUserThemeSettings = prop;
} else if (appearance != null) {
const clientThemeSettings = appearance.clientThemeSettings;
if (clientThemeSettings != null) {
customUserThemeSettings = clientThemeSettings.customUserThemeSettings;
}
}
if (null != theme) {
const tmp17Result4 = ClientThemesUtils;
return tmp17Result4.resolveThemeWithCustomSettings(theme, customUserThemeSettings);
} else {
let theme1;
if (appearance != null) {
theme1 = appearance.theme;
}
if (theme1 == null) {
theme1 = tmp17(1186).Theme.UNSET;
}
if (theme1 === preloaded_user_settings.Theme.UNSET) {
let themeWithCustomSettings;
if (arg0 !== metroImportDefault.NO_PREFERENCE) {
const tmp17Result5 = ClientThemesUtils;
themeWithCustomSettings = tmp17Result5.resolveThemeWithCustomSettings(arg1[arg0], customUserThemeSettings);
}
return themeWithCustomSettings;
}
const tmp17Result6 = ClientThemesUtils;
themeWithCustomSettings = tmp17Result6.resolveThemeWithCustomSettings(metroRequire[theme1], customUserThemeSettings);
}
}
};