Fix review comments
| @@ -52,7 +52,7 @@ const FANCY_NAMES = { | ||
| 52 | 52 | /** @type {() => SlashCommandEnumValue[]} */ |
| 53 | 53 | const profilesProvider = () => [ |
| 54 | 54 | new SlashCommandEnumValue(NONE, NONE), |
| 55 | 55 | ...extension_settings.connectionManager.profiles.map(p => new SlashCommandEnumValue(p.name, p.namenull, enumTypes.name, enumIcons.server)), |
| 56 | 56 | ]; |
| 57 | 57 | |
| 58 | 58 | /** |
| @@ -309,6 +309,11 @@ async function renderDetailsContent(details, detailsContent) { | ||
| 309 | 309 | saveSettingsDebounced(); |
| 310 | 310 | await renderDetailsContent(details, detailsContent); |
| 311 | 311 | |
| 312 | + // None option selected | |
| 313 | + if (!profileId) { | |
| 314 | + return; | |
| 315 | + } | |
| 316 | + | |
| 312 | 317 | const profile = extension_settings.connectionManager.profiles.find(p => p.id === profileId); |
| 313 | 318 | |
| 314 | 319 | if (!profile) { |
| @@ -455,11 +460,13 @@ async function renderDetailsContent(details, detailsContent) { | ||
| 455 | 460 | const selectedProfile = extension_settings.connectionManager.selectedProfile; |
| 456 | 461 | const profile = extension_settings.connectionManager.profiles.find(p => p.id === selectedProfile); |
| 457 | 462 | if (!profile) { |
| 463 | + toastr.warning('No profile selected.'); | |
| 458 | 464 | return ''; |
| 459 | 465 | } |
| 460 | 466 | await updateConnectionProfile(profile); |
| 461 | 467 | await renderDetailsContent(details, detailsContent); |
| 462 | 468 | saveSettingsDebounced(); |
| 469 | + return profile.name; | |
| 463 | 470 | }, |
| 464 | 471 | })); |
| 465 | 472 | |