Fix saving null profiles

4c4477098d061a513684bd31a9c7aede4807aca9

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +4 -1Ignore whitespace
public/scripts/extensions/connection-manager/index.js+4 -1
@@ -110,7 +110,7 @@ async function createConnectionProfile() {
110 const name = await callGenericPopup(template, POPUP_TYPE.INPUT, suggestedName, { rows: 2 });110 const name = await callGenericPopup(template, POPUP_TYPE.INPUT, suggestedName, { rows: 2 });
111111
112 if (!name) {112 if (!name) {
113 return;113 return null;
114 }114 }
115115
116 profile.name = name;116 profile.name = name;
@@ -296,6 +296,9 @@ async function renderDetailsContent(details, detailsContent) {
296 const createButton = document.getElementById('create_connection_profile');296 const createButton = document.getElementById('create_connection_profile');
297 createButton.addEventListener('click', async () => {297 createButton.addEventListener('click', async () => {
298 const profile = await createConnectionProfile();298 const profile = await createConnectionProfile();
299 if (!profile) {
300 return;
301 }
299 extension_settings.connectionManager.profiles.push(profile);302 extension_settings.connectionManager.profiles.push(profile);
300 extension_settings.connectionManager.selectedProfile = profile.id;303 extension_settings.connectionManager.selectedProfile = profile.id;
301 saveSettingsDebounced();304 saveSettingsDebounced();