mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-20 10:22:18 +01:00
Remove useStickyMarketPrice (not used anymore)
This commit is contained in:
parent
1809393b69
commit
ac7714078c
@ -475,11 +475,6 @@ public final class Preferences implements Persistable {
|
||||
persist();
|
||||
}
|
||||
|
||||
// not used anymore
|
||||
public boolean isUseStickyMarketPrice() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setSortMarketCurrenciesNumerically(boolean sortMarketCurrenciesNumerically) {
|
||||
this.sortMarketCurrenciesNumerically = sortMarketCurrenciesNumerically;
|
||||
persist();
|
||||
|
@ -816,15 +816,11 @@ public class MainViewModel implements ViewModel {
|
||||
if (newValue != null && !newValue.equals(oldValue)) {
|
||||
setMarketPriceInItems();
|
||||
|
||||
String code = preferences.isUseStickyMarketPrice() ?
|
||||
preferences.getPreferredTradeCurrency().getCode() :
|
||||
priceFeedService.currencyCodeProperty().get();
|
||||
String code = priceFeedService.currencyCodeProperty().get();
|
||||
Optional<PriceFeedComboBoxItem> itemOptional = findPriceFeedComboBoxItem(code);
|
||||
if (itemOptional.isPresent()) {
|
||||
if (selectedPriceFeedComboBoxItemProperty.get() == null || !preferences.isUseStickyMarketPrice()) {
|
||||
itemOptional.get().setDisplayString(newValue);
|
||||
selectedPriceFeedComboBoxItemProperty.set(itemOptional.get());
|
||||
}
|
||||
itemOptional.get().setDisplayString(newValue);
|
||||
selectedPriceFeedComboBoxItemProperty.set(itemOptional.get());
|
||||
} else {
|
||||
if (CurrencyUtil.isCryptoCurrency(code)) {
|
||||
CurrencyUtil.getCryptoCurrency(code).ifPresent(cryptoCurrency -> {
|
||||
@ -871,7 +867,7 @@ public class MainViewModel implements ViewModel {
|
||||
}
|
||||
|
||||
public void setPriceFeedComboBoxItem(PriceFeedComboBoxItem item) {
|
||||
if (!preferences.isUseStickyMarketPrice() && item != null) {
|
||||
if (item != null) {
|
||||
Optional<PriceFeedComboBoxItem> itemOptional = findPriceFeedComboBoxItem(priceFeedService.currencyCodeProperty().get());
|
||||
if (itemOptional.isPresent())
|
||||
selectedPriceFeedComboBoxItemProperty.set(itemOptional.get());
|
||||
@ -879,9 +875,6 @@ public class MainViewModel implements ViewModel {
|
||||
findPriceFeedComboBoxItem(preferences.getPreferredTradeCurrency().getCode())
|
||||
.ifPresent(selectedPriceFeedComboBoxItemProperty::set);
|
||||
|
||||
priceFeedService.setCurrencyCode(item.currencyCode);
|
||||
} else if (item != null) {
|
||||
selectedPriceFeedComboBoxItemProperty.set(item);
|
||||
priceFeedService.setCurrencyCode(item.currencyCode);
|
||||
} else {
|
||||
findPriceFeedComboBoxItem(preferences.getPreferredTradeCurrency().getCode())
|
||||
|
@ -175,8 +175,7 @@ class OfferBookChartViewModel extends ActivatableViewModel {
|
||||
|
||||
updateChartData();
|
||||
|
||||
if (!preferences.isUseStickyMarketPrice())
|
||||
priceFeedService.setCurrencyCode(code);
|
||||
priceFeedService.setCurrencyCode(code);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -229,7 +228,7 @@ class OfferBookChartViewModel extends ActivatableViewModel {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void syncPriceFeedCurrency() {
|
||||
if (!preferences.isUseStickyMarketPrice() && selectedTabIndex == TAB_INDEX)
|
||||
if (selectedTabIndex == TAB_INDEX)
|
||||
priceFeedService.setCurrencyCode(selectedTradeCurrencyProperty.get().getCode());
|
||||
}
|
||||
|
||||
|
@ -182,12 +182,10 @@ class TradesChartsViewModel extends ActivatableViewModel {
|
||||
|
||||
updateChartData();
|
||||
|
||||
if (!preferences.isUseStickyMarketPrice()) {
|
||||
if (showAllEntry)
|
||||
priceFeedService.setCurrencyCode(GlobalSettings.getDefaultTradeCurrency().getCode());
|
||||
else
|
||||
priceFeedService.setCurrencyCode(code);
|
||||
}
|
||||
if (showAllEntry)
|
||||
priceFeedService.setCurrencyCode(GlobalSettings.getDefaultTradeCurrency().getCode());
|
||||
else
|
||||
priceFeedService.setCurrencyCode(code);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -227,7 +225,7 @@ class TradesChartsViewModel extends ActivatableViewModel {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void setMarketPriceFeedCurrency() {
|
||||
if (!preferences.isUseStickyMarketPrice() && selectedTabIndex == TAB_INDEX) {
|
||||
if (selectedTabIndex == TAB_INDEX) {
|
||||
if (showAllTradeCurrenciesProperty.get())
|
||||
priceFeedService.setCurrencyCode(GlobalSettings.getDefaultTradeCurrency().getCode());
|
||||
else
|
||||
@ -236,7 +234,7 @@ class TradesChartsViewModel extends ActivatableViewModel {
|
||||
}
|
||||
|
||||
private void syncPriceFeedCurrency() {
|
||||
if (!preferences.isUseStickyMarketPrice() && selectedTabIndex == TAB_INDEX)
|
||||
if (selectedTabIndex == TAB_INDEX)
|
||||
priceFeedService.setCurrencyCode(selectedTradeCurrencyProperty.get().getCode());
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
||||
addBindings();
|
||||
addListeners();
|
||||
|
||||
if (!preferences.isUseStickyMarketPrice() && isTabSelected)
|
||||
if (isTabSelected)
|
||||
priceFeedService.setCurrencyCode(tradeCurrencyCode.get());
|
||||
|
||||
updateBalance();
|
||||
@ -250,8 +250,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
||||
if (this.tradeCurrency != null)
|
||||
tradeCurrencyCode.set(this.tradeCurrency.getCode());
|
||||
|
||||
if (!preferences.isUseStickyMarketPrice())
|
||||
priceFeedService.setCurrencyCode(tradeCurrencyCode.get());
|
||||
priceFeedService.setCurrencyCode(tradeCurrencyCode.get());
|
||||
|
||||
// We request to get the actual estimated fee
|
||||
requestTxFee();
|
||||
@ -279,7 +278,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
||||
|
||||
void onTabSelected(boolean isSelected) {
|
||||
this.isTabSelected = isSelected;
|
||||
if (!preferences.isUseStickyMarketPrice() && isTabSelected)
|
||||
if (isTabSelected)
|
||||
priceFeedService.setCurrencyCode(tradeCurrencyCode.get());
|
||||
}
|
||||
|
||||
@ -426,8 +425,7 @@ class CreateOfferDataModel extends ActivatableDataModel {
|
||||
if (paymentAccount != null)
|
||||
paymentAccount.setSelectedTradeCurrency(tradeCurrency);
|
||||
|
||||
if (!preferences.isUseStickyMarketPrice())
|
||||
priceFeedService.setCurrencyCode(code);
|
||||
priceFeedService.setCurrencyCode(code);
|
||||
|
||||
Optional<TradeCurrency> tradeCurrencyOptional = preferences.getTradeCurrenciesAsObservable().stream().filter(e -> e.getCode().equals(code)).findAny();
|
||||
if (!tradeCurrencyOptional.isPresent()) {
|
||||
|
@ -375,7 +375,7 @@ class OfferBookViewModel extends ActivatableViewModel {
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
private void setMarketPriceFeedCurrency() {
|
||||
if (!preferences.isUseStickyMarketPrice() && isTabSelected) {
|
||||
if (isTabSelected) {
|
||||
if (showAllTradeCurrenciesProperty.get())
|
||||
priceFeedService.setCurrencyCode(GlobalSettings.getDefaultTradeCurrency().getCode());
|
||||
else
|
||||
|
@ -129,7 +129,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||
// if (isWalletFunded.get())
|
||||
// feeFromFundingTxProperty.set(FeePolicy.getMinRequiredFeeForFundingTx());
|
||||
|
||||
if (!preferences.isUseStickyMarketPrice() && isTabSelected)
|
||||
if (isTabSelected)
|
||||
priceFeedService.setCurrencyCode(offer.getCurrencyCode());
|
||||
|
||||
tradeManager.checkOfferAvailability(offer,
|
||||
@ -236,8 +236,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||
|
||||
offer.resetState();
|
||||
|
||||
if (!preferences.isUseStickyMarketPrice())
|
||||
priceFeedService.setCurrencyCode(offer.getCurrencyCode());
|
||||
priceFeedService.setCurrencyCode(offer.getCurrencyCode());
|
||||
}
|
||||
|
||||
void requestTxFee() {
|
||||
@ -249,7 +248,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||
|
||||
void onTabSelected(boolean isSelected) {
|
||||
this.isTabSelected = isSelected;
|
||||
if (!preferences.isUseStickyMarketPrice() && isTabSelected)
|
||||
if (isTabSelected)
|
||||
priceFeedService.setCurrencyCode(offer.getCurrencyCode());
|
||||
}
|
||||
|
||||
@ -383,7 +382,7 @@ class TakeOfferDataModel extends ActivatableDataModel {
|
||||
totalToPayAsCoin.set(feeAndSecDeposit.add(amount.get()));
|
||||
else
|
||||
totalToPayAsCoin.set(feeAndSecDeposit);
|
||||
|
||||
|
||||
updateBalance();
|
||||
log.debug("totalToPayAsCoin " + totalToPayAsCoin.get().toFriendlyString());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user