| 354 | 354 | const profiles = document.getElementById('connection_profiles'); |
| 355 | 355 | renderConnectionProfiles(profiles); |
| 356 | 356 | |
| 357 | + function toggleProfileSpecificButtons() { |
| 358 | + const profileId = extension_settings.connectionManager.selectedProfile; |
| 359 | + const profileSpecificButtons = ['update_connection_profile', 'reload_connection_profile', 'delete_connection_profile']; |
| 360 | + profileSpecificButtons.forEach(id => document.getElementById(id).classList.toggle('disabled', !profileId)); |
| 361 | + } |
| 362 | + toggleProfileSpecificButtons(); |
| 363 | + |
| 357 | 364 | profiles.addEventListener('change', async function () { |
| 358 | 365 | const selectedProfile = profiles.selectedOptions[0]; |
| 359 | 366 | if (!selectedProfile) { |