From c3d0af1473dac54848e71ab71d7ffaa6749bdb85 Mon Sep 17 00:00:00 2001 From: Jack Kingsman Date: Sun, 12 Apr 2026 15:06:45 -0700 Subject: [PATCH] Fix memoization --- .../src/components/settings/SettingsFanoutSection.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/settings/SettingsFanoutSection.tsx b/frontend/src/components/settings/SettingsFanoutSection.tsx index 8d96d11..6149b2a 100644 --- a/frontend/src/components/settings/SettingsFanoutSection.tsx +++ b/frontend/src/components/settings/SettingsFanoutSection.tsx @@ -867,10 +867,14 @@ function MqttHaConfigEditor({ const selectedContacts = (config.tracked_contacts as string[]) || []; const selectedRepeaters = (config.tracked_repeaters as string[]) || []; - const contactOptions = contacts.filter((c) => c.type === 0 || c.type === 1 || c.type === 3); + const contactOptions = useMemo( + () => contacts.filter((c) => c.type === 0 || c.type === 1 || c.type === 3), + [contacts] + ); - const repeaterOptions = contacts.filter( - (c) => c.type === 2 && trackedRepeaters.includes(c.public_key) + const repeaterOptions = useMemo( + () => contacts.filter((c) => c.type === 2 && trackedRepeaters.includes(c.public_key)), + [contacts, trackedRepeaters] ); const contactSearchLower = contactSearch.toLowerCase().trim();