mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
fix updating display of current price
This commit is contained in:
parent
c7277187c5
commit
07769fd8d9
@ -429,14 +429,12 @@ public class MainView extends InitializableView<StackPane, MainViewModel> {
|
|||||||
return new ListCell<>() {
|
return new ListCell<>() {
|
||||||
@Override
|
@Override
|
||||||
protected void updateItem(PriceFeedComboBoxItem item, boolean empty) {
|
protected void updateItem(PriceFeedComboBoxItem item, boolean empty) {
|
||||||
UserThread.execute(() -> {
|
|
||||||
super.updateItem(item, empty);
|
super.updateItem(item, empty);
|
||||||
if (!empty && item != null) {
|
if (!empty && item != null) {
|
||||||
textProperty().bind(item.displayStringProperty);
|
textProperty().bind(item.displayStringProperty);
|
||||||
} else {
|
} else {
|
||||||
textProperty().unbind();
|
textProperty().unbind();
|
||||||
}
|
}
|
||||||
});
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -131,6 +131,7 @@ public class MarketPricePresentation {
|
|||||||
});
|
});
|
||||||
|
|
||||||
marketPriceBinding.subscribe((observable, oldValue, newValue) -> {
|
marketPriceBinding.subscribe((observable, oldValue, newValue) -> {
|
||||||
|
UserThread.execute(() -> {
|
||||||
if (newValue != null && !newValue.equals(oldValue)) {
|
if (newValue != null && !newValue.equals(oldValue)) {
|
||||||
setMarketPriceInItems();
|
setMarketPriceInItems();
|
||||||
|
|
||||||
@ -157,6 +158,7 @@ public class MarketPricePresentation {
|
|||||||
selectedPriceFeedComboBoxItemProperty.get().setDisplayString(newValue);
|
selectedPriceFeedComboBoxItemProperty.get().setDisplayString(newValue);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
marketPriceCurrencyCode.bind(priceFeedService.currencyCodeProperty());
|
marketPriceCurrencyCode.bind(priceFeedService.currencyCodeProperty());
|
||||||
|
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
|
|
||||||
package haveno.desktop.main.shared;
|
package haveno.desktop.main.shared;
|
||||||
|
|
||||||
import haveno.common.UserThread;
|
|
||||||
import javafx.beans.property.SimpleStringProperty;
|
import javafx.beans.property.SimpleStringProperty;
|
||||||
import javafx.beans.property.StringProperty;
|
import javafx.beans.property.StringProperty;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
@ -38,6 +37,6 @@ public class PriceFeedComboBoxItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setDisplayString(String displayString) {
|
public void setDisplayString(String displayString) {
|
||||||
UserThread.execute(() -> this.displayStringProperty.set(displayString));
|
this.displayStringProperty.set(displayString);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user