From b8df0b3ac051a3e4437e87ed87c9659652255e6c Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Tue, 8 Sep 2020 14:22:22 +0200 Subject: [PATCH] feat: boolean to disable systemAppearanceChanged (theme) --- packages/core/application/application-common.ts | 4 ++-- packages/core/application/index.d.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/core/application/application-common.ts b/packages/core/application/application-common.ts index 2a083eb32..c7cbc0385 100644 --- a/packages/core/application/application-common.ts +++ b/packages/core/application/application-common.ts @@ -148,9 +148,9 @@ export function orientationChanged(rootView: View, newOrientation: 'portrait' | applyCssClass(rootModalView, ORIENTATION_CSS_CLASSES, newOrientationCssClass); }); } - +export let autoSystemAppearanceChanged = true; export function systemAppearanceChanged(rootView: View, newSystemAppearance: 'dark' | 'light'): void { - if (!rootView) { + if (!rootView || !autoSystemAppearanceChanged) { return; } diff --git a/packages/core/application/index.d.ts b/packages/core/application/index.d.ts index 9b14fe31c..217efbecf 100644 --- a/packages/core/application/index.d.ts +++ b/packages/core/application/index.d.ts @@ -54,6 +54,10 @@ export const orientationChangedEvent: string; */ export const systemAppearanceChangedEvent: string; +/** + * Boolean to enable/disable systemAppearanceChanged + */ +export let autoSystemAppearanceChanged = true; /** * Updates root view classes including those of modals * @param rootView the root view