add toggle to enable/disable block audits

This commit is contained in:
Mononaut
2022-12-29 07:38:57 -06:00
parent 94add379d0
commit 2ed49cf944
7 changed files with 78 additions and 33 deletions

View File

@@ -118,6 +118,7 @@ export class StateService {
blockScrolling$: Subject<boolean> = new Subject<boolean>();
timeLtr: BehaviorSubject<boolean>;
hideFlow: BehaviorSubject<boolean>;
hideAudit: BehaviorSubject<boolean>;
constructor(
@Inject(PLATFORM_ID) private platformId: any,
@@ -177,6 +178,12 @@ export class StateService {
this.storageService.removeItem('flow-preference');
}
});
const savedAuditPreference = this.storageService.getValue('audit-preference');
this.hideAudit = new BehaviorSubject<boolean>(savedAuditPreference === 'hide');
this.hideAudit.subscribe((hide) => {
this.storageService.setValue('audit-preference', hide ? 'hide' : 'show');
});
}
setNetworkBasedonUrl(url: string) {