mirror of
https://github.com/mempool/mempool.git
synced 2026-08-13 12:33:11 +02:00
Add OnDestroy to theme selector component, remove console log
This commit is contained in:
parent
c0891ead52
commit
ddd996a9a5
1 changed files with 2 additions and 3 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { ThemeService } from '@app/services/theme.service';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
|
@ -10,7 +10,7 @@ import { Subscription } from 'rxjs';
|
|||
standalone: false,
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
})
|
||||
export class ThemeSelectorComponent implements OnInit {
|
||||
export class ThemeSelectorComponent implements OnInit, OnDestroy {
|
||||
themeForm: UntypedFormGroup;
|
||||
themes = ['default', 'contrast', 'softsimon', 'bukele'];
|
||||
themeStateSubscription: Subscription;
|
||||
|
|
@ -25,7 +25,6 @@ export class ThemeSelectorComponent implements OnInit {
|
|||
theme: ['default']
|
||||
});
|
||||
this.themeStateSubscription = this.themeService.themeState$.subscribe(({ theme, loading }) => {
|
||||
console.log('Theme state changed:', theme, loading);
|
||||
this.themeForm.get('theme')?.setValue(theme, { emitEvent: false });
|
||||
if (loading) {
|
||||
this.themeForm.get('theme')?.disable({ emitEvent: false });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue