Skip to content

Commit

Permalink
MOBILE-3063 reading: Avoid collapsible heading glitch
Browse files Browse the repository at this point in the history
  • Loading branch information
crazyserver committed Jan 14, 2025
1 parent 070fbc5 commit 553664c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/core/directives/reading-mode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@ export class CoreReadingModeDirective implements AfterViewInit, OnDestroy {
*/
protected async enterReadingMode(): Promise<void> {
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');

Expand Down Expand Up @@ -172,11 +172,11 @@ export class CoreReadingModeDirective implements AfterViewInit, OnDestroy {
* Disable the reading mode.
*/
protected async disableReadingMode(): Promise<void> {
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;
Expand Down

0 comments on commit 553664c

Please sign in to comment.