mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-05-01 19:12:57 +02:00
Fix memoization
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user