decord/alpha/source/modules/themes/resolveTheme.native.tsx

82 lines
3.3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 1250
// Function ID: 1251
2026-07-20 16:05:17 +00:00
// Name: resolveTheme
2026-10-09 10:00:15 +00:00
// Dependencies: [1251, 1206, 1207, 1244, 1208, 7350, 1252, 1209, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-09 10:00:15 +00:00
// Module 1250 (resolveTheme)
2026-10-08 09:57:35 +00:00
import preloaded_user_settings from "preloaded_user_settings" /* 1209 */;
2026-10-09 10:00:15 +00:00
import ClientThemesUtils from "ClientThemesUtils" /* 1252 */;
import AuthenticationUtils from "AuthenticationUtils" /* 7350 */;
import CustomThemeMobileStore from "CustomThemeMobileStore" /* 1251 */;
2026-10-08 09:57:35 +00:00
import SelectivelySyncedUserSettingsStore from "SelectivelySyncedUserSettingsStore" /* 1206 */;
import UnsyncedUserSettingsStore from "UnsyncedUserSettingsStore" /* 1207 */;
2026-10-09 10:00:15 +00:00
import UserSettingsProtoStore from "UserSettingsProtoStore" /* 1244 */;
2026-10-08 09:57:35 +00:00
import ThemeConstants from "ThemeConstants" /* 1208 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
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");
2026-07-20 16:05:17 +00:00
export default function resolveTheme(arg0, arg1) {
const previewTheme = CustomThemeMobileStore.getPreviewTheme();
2026-10-03 08:58:59 +00:00
const obj = CustomThemeMobileStore;
2026-07-20 16:05:17 +00:00
if (undefined !== previewTheme) {
return previewTheme.baseTheme;
} else {
2026-10-03 08:58:59 +00:00
let customUserThemeSettings;
const useSystemTheme = UnsyncedUserSettingsStore.useSystemTheme;
const obj6 = AuthenticationUtils;
2026-08-31 15:47:37 +00:00
if (!obj6.isAuthenticated()) {
2026-10-03 08:58:59 +00:00
if (arg0 !== metroImportDefault.NO_PREFERENCE) {
const tmp17Result = ClientThemesUtils;
return tmp17Result.resolveThemeWithCustomSettings(arg1[arg0], obj.getCustomTheme());
2026-07-20 16:05:17 +00:00
}
}
const appearanceSettings = SelectivelySyncedUserSettingsStore.getAppearanceSettings();
2026-07-20 16:05:17 +00:00
let theme;
2026-07-29 08:29:29 +00:00
if (appearanceSettings != null) {
2026-07-20 16:05:17 +00:00
theme = appearanceSettings.theme;
}
const appearance = UserSettingsProtoStore.settings.appearance;
2026-08-11 06:20:06 +00:00
if (null != appearanceSettings) {
const clientThemeSettings2 = appearanceSettings.clientThemeSettings;
let prop;
if (clientThemeSettings2 != null) {
prop = clientThemeSettings2.customUserThemeSettings;
}
2026-10-03 08:58:59 +00:00
customUserThemeSettings = prop;
2026-08-11 06:20:06 +00:00
} else if (appearance != null) {
const clientThemeSettings = appearance.clientThemeSettings;
if (clientThemeSettings != null) {
customUserThemeSettings = clientThemeSettings.customUserThemeSettings;
}
}
2026-07-20 16:05:17 +00:00
if (null != theme) {
2026-10-03 08:58:59 +00:00
const tmp17Result4 = ClientThemesUtils;
return tmp17Result4.resolveThemeWithCustomSettings(theme, customUserThemeSettings);
2026-07-20 16:05:17 +00:00
} else {
let theme1;
2026-07-29 08:29:29 +00:00
if (appearance != null) {
2026-07-20 16:05:17 +00:00
theme1 = appearance.theme;
}
2026-07-29 08:29:29 +00:00
if (theme1 == null) {
2026-10-08 09:57:35 +00:00
theme1 = tmp17(1209).Theme.UNSET;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
if (theme1 === preloaded_user_settings.Theme.UNSET) {
let themeWithCustomSettings;
if (arg0 !== metroImportDefault.NO_PREFERENCE) {
const tmp17Result5 = ClientThemesUtils;
themeWithCustomSettings = tmp17Result5.resolveThemeWithCustomSettings(arg1[arg0], customUserThemeSettings);
2026-07-20 16:05:17 +00:00
}
2026-08-31 15:47:37 +00:00
return themeWithCustomSettings;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
const tmp17Result6 = ClientThemesUtils;
themeWithCustomSettings = tmp17Result6.resolveThemeWithCustomSettings(metroRequire[theme1], customUserThemeSettings);
2026-07-20 16:05:17 +00:00
}
}
};