Skip to content

Commit 7128664

Browse files
committed
fix connection error color mismatch
1 parent 5b08c66 commit 7128664

File tree

2 files changed

+24
-13
lines changed

2 files changed

+24
-13
lines changed

core/src/main/java/haveno/core/app/WalletAppSetup.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,8 @@ void init(@Nullable Consumer<String> chainFileLockedExceptionHandler,
188188
} else {
189189
xmrConnectionService.getConnectionServiceErrorMsg().set(Res.get("mainView.walletServiceErrorMsg.connectionError", exception.getMessage()));
190190
}
191+
} else {
192+
xmrConnectionService.getConnectionServiceErrorMsg().set(errorMsg);
191193
}
192194
}
193195
return result;

desktop/src/main/java/haveno/desktop/main/MainView.java

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,15 @@ private VBox createSplashScreen() {
553553
xmrSplashInfo = new AutoTooltipLabel();
554554
xmrSplashInfo.textProperty().bind(model.getXmrInfo());
555555
walletServiceErrorMsgListener = (ov, oldValue, newValue) -> {
556-
xmrSplashInfo.setId("splash-error-state-msg");
557-
xmrSplashInfo.getStyleClass().add("error-text");
556+
UserThread.execute(() -> {
557+
if (newValue != null && !newValue.isEmpty()) {
558+
xmrSplashInfo.setId("splash-error-state-msg");
559+
if (!xmrSplashInfo.getStyleClass().contains("error-text")) xmrSplashInfo.getStyleClass().add("error-text");
560+
} else {
561+
xmrSplashInfo.setId("");
562+
xmrSplashInfo.getStyleClass().remove("error-text");
563+
}
564+
});
558565
};
559566
model.getConnectionServiceErrorMsg().addListener(walletServiceErrorMsgListener);
560567

@@ -710,17 +717,19 @@ private AnchorPane createFooter() {
710717
//blockchainSyncIndicator.progressProperty().bind(model.getCombinedSyncProgress());
711718

712719
model.getConnectionServiceErrorMsg().addListener((ov, oldValue, newValue) -> {
713-
if (newValue != null) {
714-
xmrInfoLabel.setId("splash-error-state-msg");
715-
xmrInfoLabel.getStyleClass().add("error-text");
716-
xmrNetworkWarnMsgPopup = new Popup().warning(newValue);
717-
xmrNetworkWarnMsgPopup.show();
718-
} else {
719-
xmrInfoLabel.setId("footer-pane");
720-
xmrInfoLabel.getStyleClass().remove("error-text");
721-
if (xmrNetworkWarnMsgPopup != null)
722-
xmrNetworkWarnMsgPopup.hide();
723-
}
720+
UserThread.execute(() -> {
721+
if (newValue != null && !newValue.isEmpty()) {
722+
xmrInfoLabel.setId("splash-error-state-msg");
723+
if (!xmrInfoLabel.getStyleClass().contains("error-text")) xmrInfoLabel.getStyleClass().add("error-text");
724+
xmrNetworkWarnMsgPopup = new Popup().warning(newValue);
725+
xmrNetworkWarnMsgPopup.show();
726+
} else {
727+
xmrInfoLabel.setId("footer-pane");
728+
xmrInfoLabel.getStyleClass().remove("error-text");
729+
if (xmrNetworkWarnMsgPopup != null)
730+
xmrNetworkWarnMsgPopup.hide();
731+
}
732+
});
724733
});
725734

726735
model.getTopErrorMsg().addListener((ov, oldValue, newValue) -> {

0 commit comments

Comments
 (0)