Merge pull request #2133 from crazyserver/MOBILE-3144

MOBILE-3144 settings: Avoid auto color scheme on iOS
main
Juan Leyva 2019-10-24 14:51:58 +02:00 committed by GitHub
commit 9db39a08fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -48,7 +48,7 @@ export class CoreSettingsGeneralPage {
colorSchemes = [];
selectedScheme: string;
constructor(appProvider: CoreAppProvider, private configProvider: CoreConfigProvider, fileProvider: CoreFileProvider,
constructor(private appProvider: CoreAppProvider, private configProvider: CoreConfigProvider, fileProvider: CoreFileProvider,
private eventsProvider: CoreEventsProvider, private langProvider: CoreLangProvider,
private domUtils: CoreDomUtilsProvider, private pushNotificationsProvider: CorePushNotificationsProvider,
localNotificationsProvider: CoreLocalNotificationsProvider, private settingsHelper: CoreSettingsHelper) {
@ -65,8 +65,9 @@ export class CoreSettingsGeneralPage {
if (!CoreConfigConstants.forceColorScheme) {
let defaultColorScheme = 'light';
if (window.matchMedia('(prefers-color-scheme: dark)').matches ||
window.matchMedia('(prefers-color-scheme: light)').matches) {
// Auto is not working on iOS right now until we update Webkit.
if (!this.appProvider.isIOS() && (window.matchMedia('(prefers-color-scheme: dark)').matches ||
window.matchMedia('(prefers-color-scheme: light)').matches)) {
this.colorSchemes.push('auto');
defaultColorScheme = 'auto';
}