Skip to content

Commit

Permalink
Block repeated error popups
Browse files Browse the repository at this point in the history
  • Loading branch information
ManfredKarrer committed Dec 28, 2015
1 parent 2701af8 commit 5a6083f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions gui/src/main/java/io/bitsquare/app/BitsquareApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ public class BitsquareApp extends Application {

private BitsquareAppModule bitsquareAppModule;
private Injector injector;
private boolean popupOpened;

public static Stage getPrimaryStage() {
return primaryStage;
Expand Down Expand Up @@ -227,11 +228,14 @@ private void showErrorPopup(Throwable throwable, boolean doShutDown) {
try {
throwable.printStackTrace();
try {
String message = throwable.getMessage();
if (message != null)
new Popup().error(message).show();
else
new Popup().error(throwable.toString()).show();
if (!popupOpened) {
String message = throwable.getMessage();
popupOpened = true;
if (message != null)
new Popup().error(message).onClose(() -> popupOpened = false).show();
else
new Popup().error(throwable.toString()).onClose(() -> popupOpened = false).show();
}
} catch (Throwable throwable3) {
log.error("Error at displaying Throwable.");
throwable3.printStackTrace();
Expand Down

0 comments on commit 5a6083f

Please sign in to comment.