From aa41db2c5c6467023d059d70feb5d7ca7210e51c Mon Sep 17 00:00:00 2001 From: Mert Sincan Date: Tue, 10 Dec 2024 12:16:06 +0000 Subject: [PATCH] Update appconfigservice.ts --- apps/showcase/service/appconfigservice.ts | 25 ++++++++++------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/apps/showcase/service/appconfigservice.ts b/apps/showcase/service/appconfigservice.ts index 79451371e16..79a119e1f1d 100644 --- a/apps/showcase/service/appconfigservice.ts +++ b/apps/showcase/service/appconfigservice.ts @@ -1,6 +1,6 @@ +import { AppState } from '@/domain/appstate'; import { DOCUMENT, isPlatformBrowser } from '@angular/common'; import { computed, effect, inject, Injectable, PLATFORM_ID, signal } from '@angular/core'; -import { AppState } from '@/domain/appstate'; @Injectable({ providedIn: 'root' }) @@ -26,19 +26,16 @@ export class AppConfigService { constructor() { this.appState.set({ ...this.loadAppState() }); - effect( - () => { - const state = this.appState(); - - if (!this.initialized || !state) { - this.initialized = true; - return; - } - this.saveAppState(state); - this.handleDarkModeTransition(state); - }, - { allowSignalWrites: true } - ); + effect(() => { + const state = this.appState(); + + if (!this.initialized || !state) { + this.initialized = true; + return; + } + this.saveAppState(state); + this.handleDarkModeTransition(state); + }); } private handleDarkModeTransition(state: AppState): void {