Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 2 additions & 11 deletions packages/core/src/codewhisperer/util/customizationUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const onProfileChangedListener: (event: ProfileChangedEvent) => any = asy
if (event.intent === 'customization') {
return
}
const logger = getLogger()

if (!event.profile) {
await setSelectedCustomization(baseCustomization)
return
Expand All @@ -69,16 +69,7 @@ export const onProfileChangedListener: (event: ProfileChangedEvent) => any = asy
const selectedCustomization = getSelectedCustomization()
// No need to validate base customization which has empty arn.
if (selectedCustomization.arn.length > 0) {
const customizationProvider = await CustomizationProvider.init(event.profile)
const customizations = await customizationProvider.listAvailableCustomizations()

const r = customizations.find((it) => it.arn === selectedCustomization.arn)
if (!r) {
logger.debug(
`profile ${event.profile.name} doesnt have access to customization ${selectedCustomization.name} but has access to ${customizations.map((it) => it.name)}`
)
await switchToBaseCustomizationAndNotify()
}
await switchToBaseCustomizationAndNotify()
}
}

Expand Down
Loading