File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
desktop/src/main/java/haveno/desktop/main/overlays/popups Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,15 @@ public class PopupManager {
32
32
private static Popup displayedPopup ;
33
33
34
34
public static void queueForDisplay (Popup popup ) {
35
+ if (hasDuplicatePopup (popup )) {
36
+ log .warn ("The popup is already in the queue or displayed.\n \t " +
37
+ "New popup not added=" + popup );
38
+ return ;
39
+ }
35
40
boolean result = popups .offer (popup );
36
41
if (!result )
37
42
log .warn ("The capacity is full with popups in the queue.\n \t " +
38
- "Not added new popup =" + popup );
43
+ "New popup not added =" + popup );
39
44
displayNext ();
40
45
}
41
46
@@ -57,4 +62,16 @@ private static void displayNext() {
57
62
}
58
63
}
59
64
}
65
+
66
+ private static boolean hasDuplicatePopup (Popup popup ) {
67
+ if (displayedPopup != null && displayedPopup .toString ().equals (popup .toString ())) {
68
+ return true ;
69
+ }
70
+ for (Popup p : popups ) {
71
+ if (p .toString ().equals (popup .toString ())) {
72
+ return true ;
73
+ }
74
+ }
75
+ return false ;
76
+ }
60
77
}
You can’t perform that action at this time.
0 commit comments