28 lines
1.5 KiB
TypeScript
28 lines
1.5 KiB
TypeScript
// Metro module 1345 (f1346).
|
|
import CustomThemeMobileStore from "../client_themes/native/CustomThemeMobileStore";
|
|
import SelectivelySyncedUserSettingsStore from "../user_settings/SelectivelySyncedUserSettingsStore";
|
|
import UnsyncedUserSettingsStore from "../user_settings/UnsyncedUserSettingsStore";
|
|
import UserSettingsProtoStore from "../user_settings/UserSettingsProtoStore";
|
|
import { PROTO_THEME_MAP_MOBILE, PROTO_THEME_MAP_MOBILE_REFRESH, SystemTheme, SystemThemeState } from "../user_settings/ThemeConstants";
|
|
import { isAuthenticated } from "../../utils/AuthenticationUtils";
|
|
import { Theme } from "../../_bundle/Module1306";
|
|
import { isMobileVisualRefreshEnabled } from "./experiments/MobileVisualRefreshExperiment";
|
|
export default function resolveTheme(a0, a1) {
|
|
const previewTheme = CustomThemeMobileStore.getPreviewTheme();
|
|
if (previewTheme !== void 0) {
|
|
return previewTheme.baseTheme;
|
|
}
|
|
if (!(isAuthenticated() && UnsyncedUserSettingsStore.useSystemTheme !== SystemThemeState.ON) && a0 !== SystemTheme.NO_PREFERENCE) {
|
|
return a1[a0];
|
|
}
|
|
const theme = SelectivelySyncedUserSettingsStore.getAppearanceSettings()?.theme;
|
|
if (theme != null) {
|
|
return theme;
|
|
}
|
|
let r29 = UserSettingsProtoStore.settings.appearance?.theme;
|
|
if (r29 == null) {
|
|
r29 = Theme.UNSET;
|
|
}
|
|
return r29 === Theme.UNSET && a0 !== SystemTheme.NO_PREFERENCE ? a1[a0] : (isMobileVisualRefreshEnabled("resolveTheme") ? PROTO_THEME_MAP_MOBILE_REFRESH : PROTO_THEME_MAP_MOBILE)[r29];
|
|
};
|