Skip to content

Commit f13320b

Browse files
committed
Fixed adding annotation multiple time
1 parent 72ecd90 commit f13320b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/main/kotlin/org/digma/intellij/plugin/ui/common/Panels.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ fun createNoObservabilityPanel(project: Project, insightsModel: InsightsModel):
125125
addButton = button("Add Annotation"){
126126
val succeeded = model.instrumentMethod()
127127
if(succeeded){
128+
addButton.enabled(false)
129+
}
130+
else{
128131
NotificationUtil.notifyError(project, "Failed to add annotation")
129132
}
130133
}.horizontalAlign(HorizontalAlign.CENTER)

src/main/kotlin/org/digma/intellij/plugin/ui/list/insights/InsightsCommon.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,9 @@ fun noObservabilityInsightPanel(project: Project, insight: NoObservability): JPa
420420
addAnnotationButton.addActionListener{
421421
ActivityMonitor.getInstance(project).registerInsightButtonClicked("add-annotation")
422422
val succeeded = model.instrumentMethod()
423-
if(!succeeded){
423+
if (succeeded) {
424+
addAnnotationButton.isEnabled = false
425+
} else {
424426
NotificationUtil.notifyError(project, "Failed to add annotation")
425427
}
426428
}

0 commit comments

Comments
 (0)