mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-24 15:10:44 +01:00
Use BSQ Swap as default when BSQ offer is created
This commit is contained in:
parent
5b67766109
commit
1712f7498e
2 changed files with 7 additions and 4 deletions
|
@ -291,12 +291,15 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
|
|||
return;
|
||||
}
|
||||
|
||||
View view = viewLoader.load(paymentMethod != null && paymentMethod.isBsqSwap() ? BsqSwapCreateOfferView.class : childViewClass);
|
||||
View view;
|
||||
// CreateOffer and TakeOffer must not be cached by ViewLoader as we cannot use a view multiple times
|
||||
// in different graphs
|
||||
if (paymentMethod != null && paymentMethod.isBsqSwap()) {
|
||||
if ((paymentMethod != null && paymentMethod.isBsqSwap()) ||
|
||||
(paymentMethod == null && viewClass.isAssignableFrom(BsqOfferBookView.class))) {
|
||||
view = viewLoader.load(BsqSwapCreateOfferView.class);
|
||||
((BsqSwapCreateOfferView) view).initWithData(direction, offerActionHandler, payload);
|
||||
} else {
|
||||
view = viewLoader.load(childViewClass);
|
||||
((CreateOfferView) view).initWithData(direction, tradeCurrency, offerActionHandler);
|
||||
}
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
|||
|
||||
abstract void saveSelectedCurrencyCodeInPreferences(OfferDirection direction, String code);
|
||||
|
||||
void onSetPaymentMethod(PaymentMethod paymentMethod) {
|
||||
protected void onSetPaymentMethod(PaymentMethod paymentMethod) {
|
||||
if (paymentMethod == null)
|
||||
return;
|
||||
|
||||
|
@ -613,7 +613,7 @@ abstract class OfferBookViewModel extends ActivatableViewModel {
|
|||
return id.equals(GUIUtil.EDIT_FLAG);
|
||||
}
|
||||
|
||||
int getNumTrades(Offer offer) {
|
||||
public int getNumTrades(Offer offer) {
|
||||
return Stream.concat(closedTradableManager.getTradableList().stream(), bsqSwapTradeManager.getTradableList().stream())
|
||||
.filter(e -> e instanceof Trade || e instanceof BsqSwapTrade) // weed out canceled offers
|
||||
.filter(e -> {
|
||||
|
|
Loading…
Add table
Reference in a new issue