Persist the show labels or not for sidemenu

This commit is contained in:
SondreB 2023-01-19 23:20:15 +01:00
parent 3e544fb539
commit 2ec41d1e5f
No known key found for this signature in database
GPG Key ID: D6CC44C75005FDBF
2 changed files with 9 additions and 0 deletions

View File

@ -70,6 +70,8 @@ export class AppComponent {
});
}
this.displayLabels = !this.options.values.hideSideLabels;
// This must happen in the constructor on app component, or when loading in PWA, it won't
// be possible to read the query parameters.
const queryParam = globalThis.location.search;
@ -110,6 +112,11 @@ export class AppComponent {
this.displayLabels = !this.displayLabels;
this.cd.detectChanges();
setTimeout(() => {
this.options.values.hideSideLabels = !this.displayLabels;
this.options.save();
}, 250);
// this._container._ngZone.onMicrotaskEmpty.subscribe(() => {
// this._container._updateStyles();
// this._container._changeDetectorRef.markForCheck();

View File

@ -1,4 +1,5 @@
import { Injectable } from '@angular/core';
import { boolean } from 'joi';
export interface Options {
hideSpam?: boolean;
@ -11,6 +12,7 @@ export interface Options {
showLines: boolean;
showMediaPlayer?: boolean;
enableSpotify?: boolean;
hideSideLabels?: boolean;
}
@Injectable({