From 553664ce68857838dd09df94c22267b7b58562d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 14 Jan 2025 14:53:43 +0100 Subject: [PATCH] MOBILE-3063 reading: Avoid collapsible heading glitch --- src/core/directives/reading-mode.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/directives/reading-mode.ts b/src/core/directives/reading-mode.ts index 476efb097..a6f066f04 100644 --- a/src/core/directives/reading-mode.ts +++ b/src/core/directives/reading-mode.ts @@ -132,9 +132,9 @@ export class CoreReadingModeDirective implements AfterViewInit, OnDestroy { */ protected async enterReadingMode(): Promise { this.enabled = true; - CoreViewer.loadReadingModeSettings(); + await CoreViewer.loadReadingModeSettings(); - this.header?.setEnabled(false); + await this.header?.setEnabled(false); document.body.classList.add('core-reading-mode-enabled'); @@ -172,11 +172,11 @@ export class CoreReadingModeDirective implements AfterViewInit, OnDestroy { * Disable the reading mode. */ protected async disableReadingMode(): Promise { + await this.header?.setEnabled(true); + this.enabled = false; document.body.classList.remove('core-reading-mode-enabled'); - this.header?.setEnabled(true); - // Enable all styles in element. this.disabledStyles.forEach((style) => { style.disabled = false;