fix: resolve infinite loop in home settings subscription

- Remove immediate listener call in subscribe() to prevent effect loop
- Use onMount instead of $effect for subscriptions to avoid reactive tracking
- Combine onMount callbacks in HomeView
This commit is contained in:
vicrodh committed 2026-01-11 00:49:38 -06:00
1 parent 3f863b5b40
commit 99c157d100
3 files changed
+12 -10

No files matched your search

+3 -2
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import { onMount } from 'svelte';
import { ChevronUp, ChevronDown, RotateCcw } from 'lucide-svelte';
import Modal from './Modal.svelte';
import {
@@ -23,8 +24,8 @@
let settings = $state<HomeSettings>(getSettings());
let customGreetingInput = $state(settings.greeting.customText || '');
// Subscribe to settings changes
$effect(() => {
// Subscribe to settings changes (use onMount to avoid reactive tracking)
onMount(() => {
const unsubscribe = subscribe(() => {
settings = getSettings();
customGreetingInput = settings.greeting.customText || '';