File tree 3 files changed +14
-6
lines changed
apps/desktop/desktop/src/main/java/bisq/desktop/main
3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -49,8 +49,11 @@ public AlertBannerController(ServiceProvider serviceProvider) {
49
49
@ Override
50
50
public void onActivate () {
51
51
unconsumedAlertsPin = alertNotificationsService .getUnconsumedAlerts ().addObserver (this ::showAlertBanner );
52
- isBisqEasyNotificationVisiblePin = bisqEasyNotificationsService .getIsNotificationPanelVisible ().addObserver (
53
- this ::updateIsBisqEasyNotificationVisible );
52
+ isBisqEasyNotificationVisiblePin = bisqEasyNotificationsService .getIsNotificationPanelVisible ().addObserver (isVisible -> {
53
+ if (isVisible != null ) {
54
+ updateIsBisqEasyNotificationVisible (isVisible );
55
+ }
56
+ });
54
57
}
55
58
56
59
@ Override
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public class AlertBannerModel implements Model {
32
32
private final StringProperty headline = new SimpleStringProperty ();
33
33
private final StringProperty message = new SimpleStringProperty ();
34
34
private final ObjectProperty <AlertType > alertType = new SimpleObjectProperty <>();
35
- private final BooleanProperty isBisqEasyNotificationVisible = new SimpleBooleanProperty ();
35
+ private final BooleanProperty isBisqEasyNotificationVisible = new SimpleBooleanProperty (false );
36
36
37
37
public AlertBannerModel () {
38
38
}
Original file line number Diff line number Diff line change 22
22
import bisq .bonded_roles .security_manager .alert .AlertNotificationsService ;
23
23
import bisq .common .observable .Pin ;
24
24
import bisq .desktop .ServiceProvider ;
25
+ import bisq .desktop .common .threading .UIThread ;
25
26
import bisq .desktop .common .view .TabController ;
26
27
import lombok .extern .slf4j .Slf4j ;
27
28
@@ -57,8 +58,12 @@ public void onDeactivate() {
57
58
}
58
59
59
60
private void updateIsNotificationVisible () {
60
- model .getIsNotificationVisible ().set (
61
- bisqEasyNotificationsService .getIsNotificationPanelVisible ().get ()
62
- || alertNotificationsService .getIsAlertBannerVisible ().get ());
61
+ UIThread .run (() -> {
62
+ boolean isNotificationPanelVisible = bisqEasyNotificationsService .getIsNotificationPanelVisible () != null
63
+ && bisqEasyNotificationsService .getIsNotificationPanelVisible ().get ();
64
+ boolean isAlertBannerVisible = alertNotificationsService .getIsAlertBannerVisible () != null
65
+ && alertNotificationsService .getIsAlertBannerVisible ().get ();
66
+ model .getIsNotificationVisible ().set (isNotificationPanelVisible || isAlertBannerVisible );
67
+ });
63
68
}
64
69
}
You can’t perform that action at this time.
0 commit comments