From 200bfa24cd4a7f4eb7863d73472942c2505dfa8b 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:10:12 +0200 Subject: [PATCH] Add files via upload --- kontakt/index.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/kontakt/index.html b/kontakt/index.html index 4592d48..6c4a012 100644 --- a/kontakt/index.html +++ b/kontakt/index.html @@ -172,13 +172,18 @@ } function showContactsList() { - document.getElementById('contactsList').classList.remove('hidden'); - document.getElementById('error').classList.add('hidden'); + const contactsList = document.getElementById('contactsList'); + const errorElement = document.getElementById('error'); + + if (contactsList) contactsList.classList.remove('hidden'); + if (errorElement) errorElement.classList.add('hidden'); // Show default tab (main contacts) if none active + const mainBtn = document.querySelector('.switcher-btn[data-type="main"]'); const activeBtn = document.querySelector('.switcher-btn.active'); - if (!activeBtn) { - document.querySelector('.switcher-btn[data-type="main"]').classList.add('active'); + + if (!activeBtn && mainBtn) { + mainBtn.classList.add('active'); } filterContacts();