diff --git a/public/scripts/extensions/connection-manager/index.js b/public/scripts/extensions/connection-manager/index.js index 583738f72..7f30a8cc7 100644 --- a/public/scripts/extensions/connection-manager/index.js +++ b/public/scripts/extensions/connection-manager/index.js @@ -354,6 +354,13 @@ async function renderDetailsContent(detailsContent) { const profiles = document.getElementById('connection_profiles'); renderConnectionProfiles(profiles); + function toggleProfileSpecificButtons() { + const profileId = extension_settings.connectionManager.selectedProfile; + const profileSpecificButtons = ['update_connection_profile', 'reload_connection_profile', 'delete_connection_profile']; + profileSpecificButtons.forEach(id => document.getElementById(id).classList.toggle('disabled', !profileId)); + } + toggleProfileSpecificButtons(); + profiles.addEventListener('change', async function () { const selectedProfile = profiles.selectedOptions[0]; if (!selectedProfile) { @@ -367,6 +374,8 @@ async function renderDetailsContent(detailsContent) { saveSettingsDebounced(); await renderDetailsContent(detailsContent); + toggleProfileSpecificButtons(); + // None option selected if (!profileId) { await eventSource.emit(event_types.CONNECTION_PROFILE_LOADED, NONE);