Skip to content

Commit 545a876

Browse files
committed
append profile
1 parent 8c978e3 commit 545a876

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

plugins/amazonq/codewhisperer/jetbrains-community/src/software/aws/toolkits/jetbrains/services/codewhisperer/customization/CodeWhispererModelConfigurator.kt

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,17 @@ class DefaultCodeWhispererModelConfigurator : CodeWhispererModelConfigurator, Pe
149149
activeCustomization(project)?.let { activeCustom ->
150150
if (aggregatedCustomizations.isEmpty()) {
151151
invalidateSelectedAndNotify(project)
152-
} else if (!aggregatedCustomizations.any { latestCustom -> latestCustom.arn == activeCustom.arn } ||
153-
(activeCustom.profile != null && activeCustom.profile != QRegionProfileManager.getInstance().activeProfile(project))
154-
) {
155-
invalidateSelectedAndNotify(project)
152+
} else {
153+
if (activeCustom.profile == null) {
154+
aggregatedCustomizations.find { latestCustom -> latestCustom.arn == activeCustom.arn }?.profile?.let { matchedProfile ->
155+
activeCustom.profile = matchedProfile
156+
}
157+
}
158+
if (!aggregatedCustomizations.any { latestCustom -> latestCustom.arn == activeCustom.arn } ||
159+
(activeCustom.profile != null && activeCustom.profile != QRegionProfileManager.getInstance().activeProfile(project))
160+
) {
161+
invalidateSelectedAndNotify(project)
162+
}
156163
}
157164
}
158165

0 commit comments

Comments
 (0)