From d7d7f9a756a58cf0f248f9858926de3e1f6e1a39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Dvo=C5=99=C3=A1k?= <150935816+Dvorinka@users.noreply.github.com> Date: Fri, 23 May 2025 10:17:24 +0200 Subject: [PATCH] Add files via upload --- kontakt/index.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kontakt/index.html b/kontakt/index.html index 4d20adc..d550be8 100644 --- a/kontakt/index.html +++ b/kontakt/index.html @@ -211,14 +211,16 @@ const activeTab = document.querySelector('.switcher-btn.active')?.dataset.type || 'main'; // Get contacts for active tab - const contacts = activeTab === 'main' ? currentData.Contacts : currentData.InternalContacts; + const contacts = activeTab === 'main' ? + (currentData?.Contacts || []) : + (currentData?.InternalContacts || []); // Apply search filter const filteredContacts = query ? contacts.filter(c => - c.name.toLowerCase().includes(query) || - c.position.toLowerCase().includes(query) || - c.phone.includes(query) || + (c.name && c.name.toLowerCase().includes(query)) || + (c.position && c.position.toLowerCase().includes(query)) || + (c.phone && c.phone.includes(query)) || (c.service_phone && c.service_phone.includes(query)) ) : contacts;