Remove unused country code selection (#37397)

This commit is contained in:
Darren Griffin 2025-02-10 18:48:07 +00:00 committed by GitHub
parent 8630f9bfaa
commit 2e74958101
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -116,9 +116,6 @@
let tabContents = dialog.querySelectorAll('.ha-buy-dialog-tab-content');
let timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
let region = timezone.split('/')[0].toLowerCase();
let locale = Intl.DateTimeFormat().resolvedOptions().locale;
let countryCode = locale.split('-')[1].toLowerCase();
let defaultTab = dialog.querySelector(`.ha-buy-dialog-sidebar-tab[data-tab="#${region}"]`);
if (defaultTab) {
@ -128,11 +125,6 @@
defaultTab.classList.add('active');
let tabContent = document.querySelector(defaultTab.getAttribute('data-tab'));
tabContent.classList.add('active');
let country = tabContent.querySelector(`.ha-buy-dialog-distributor-country[data-code="${countryCode}"]`);
if (country) {
country.scrollIntoView({ behavior: 'instant', block: 'center' });
}
}
}
</script>
</script>