From 43f1d50a36fb337148b355670b1b880537034c97 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Tue, 8 Sep 2020 14:43:54 +0200 Subject: [PATCH] fix: need to be a function to work --- packages/core/application/application-common.ts | 5 +++++ packages/core/application/index.d.ts | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/packages/core/application/application-common.ts b/packages/core/application/application-common.ts index c7cbc0385..d27dee9c5 100644 --- a/packages/core/application/application-common.ts +++ b/packages/core/application/application-common.ts @@ -149,6 +149,11 @@ export function orientationChanged(rootView: View, newOrientation: 'portrait' | }); } export let autoSystemAppearanceChanged = true; + +export function setAutoSystemAppearanceChanged(value: boolean) { + autoSystemAppearanceChanged = value; +} + export function systemAppearanceChanged(rootView: View, newSystemAppearance: 'dark' | 'light'): void { if (!rootView || !autoSystemAppearanceChanged) { return; diff --git a/packages/core/application/index.d.ts b/packages/core/application/index.d.ts index 217efbecf..9d0106c3a 100644 --- a/packages/core/application/index.d.ts +++ b/packages/core/application/index.d.ts @@ -58,6 +58,12 @@ export const systemAppearanceChangedEvent: string; * Boolean to enable/disable systemAppearanceChanged */ export let autoSystemAppearanceChanged = true; + +/** + * enable/disable systemAppearanceChanged + */ +export function setAutoSystemAppearanceChanged (value: boolean); + /** * Updates root view classes including those of modals * @param rootView the root view