diff --git a/src/ts/uifactory.ts b/src/ts/uifactory.ts index 6189d3b2b..627e47308 100644 --- a/src/ts/uifactory.ts +++ b/src/ts/uifactory.ts @@ -569,7 +569,7 @@ export namespace UIFactory { }); } - export function superModernUI() { + export function superModernUI(config: UIConfig) { let subtitleOverlay = new SubtitleOverlay(); let mainSettingsPanelPage: SettingsPanelPage; @@ -603,14 +603,16 @@ export namespace UIFactory { }), ]; - const ecoModeContainer = new EcoModeContainer(); + if (config.ecoMode) { + const ecoModeContainer = new EcoModeContainer(); - ecoModeContainer.setOnToggleCallback(() => { - // forces the browser to re-calculate the height of the settings panel when adding/removing elements - settingsPanel.getDomElement().css({ width: '', height: '' }); - }); + ecoModeContainer.setOnToggleCallback(() => { + // forces the browser to re-calculate the height of the settings panel when adding/removing elements + settingsPanel.getDomElement().css({ width: '', height: '' }); + }); - components.unshift(ecoModeContainer); + components.unshift(ecoModeContainer); + } mainSettingsPanelPage = new SettingsPanelPage({ components, @@ -734,7 +736,7 @@ export namespace UIFactory { }, }, { - ui: superModernUI(), + ui: superModernUI(config), condition: (context: UIConditionContext) => { return !context.isAd && !context.adRequiresUi; },