Switch to open offers after creating a new offer

This commit is contained in:
Christoph Atteneder 2022-04-22 10:01:35 +02:00
parent 4ce861add1
commit 4447435e5f
No known key found for this signature in database
GPG key ID: CD5DC1C529CDFD3B
4 changed files with 26 additions and 22 deletions

View file

@ -433,7 +433,6 @@ offerbook.info.sellAboveMarketPrice=You will get {0} more than the current marke
offerbook.info.buyBelowMarketPrice=You will pay {0} less than the current market price (updated every minute).
offerbook.info.buyAtFixedPrice=You will buy at this fixed price.
offerbook.info.sellAtFixedPrice=You will sell at this fixed price.
offerbook.info.noArbitrationInUserLanguage=In case of a dispute, please note that arbitration for this offer will be handled in {0}. Language is currently set to {1}.
offerbook.info.roundedFiatVolume=The amount was rounded to increase the privacy of your trade.
offerbook.info.accountCreated.headline=Congratulations
offerbook.info.accountCreated.message=You''ve just successfully created a BSQ payment account.\n\
@ -585,7 +584,6 @@ takeOffer.takeOfferFundWalletInfo.headline=Fund your trade
takeOffer.takeOfferFundWalletInfo.tradeAmount=- Trade amount: {0} \n
takeOffer.takeOfferFundWalletInfo.msg=You need to deposit {0} to take this offer.\n\nThe amount is the sum of:\n{1}- Your security deposit: {2}\n- Trading fee: {3}\n- Total mining fees: {4}\n\nYou can choose between two options when funding your trade:\n- Use your Bisq wallet (convenient, but transactions may be linkable) OR\n- Transfer from an external wallet (potentially more private)\n\nYou will see all funding options and details after closing this popup.
takeOffer.alreadyPaidInFunds=If you have already paid in funds you can withdraw it in the \"Funds/Send funds\" screen.
takeOffer.paymentInfo=Payment info
takeOffer.setAmountPrice=Set amount
takeOffer.alreadyFunded.askCancel=You have already funded that offer.\nIf you cancel now, your funds will be moved to your local Bisq wallet and are available for withdrawal in the \"Funds/Send funds\" screen.\nAre you sure you want to cancel?
takeOffer.failed.offerNotAvailable=Take offer request failed because the offer is not available anymore. Maybe another trader has taken the offer in the meantime.

View file

@ -309,10 +309,10 @@ public abstract class OfferView extends ActivatableView<TabPane, Void> {
((ClosableView) view).setCloseHandler(() -> {
offerBookView.enableCreateOfferButton();
((SelectableView) view).onTabSelected(false);
//reset tab
navigation.navigateTo(MainView.class, this.getClass(), viewClass);
});
// close handler from close on create offer action
marketOfferBookTab.setContent(view.getRoot());
}

View file

@ -812,18 +812,12 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
.feedback(Res.get("createOffer.success.info"))
.dontShowAgainId(key)
.actionButtonTextWithGoTo("navigation.portfolio.myOpenOffers")
.onAction(() -> {
UserThread.runAfter(() ->
navigation.navigateTo(MainView.class, PortfolioView.class,
OpenOffersView.class),
100, TimeUnit.MILLISECONDS);
close();
})
.onClose(this::close)
.onAction(this::closeAndGoToOpenOffers)
.onClose(this::closeAndGoToOpenOffers)
.show(),
1);
} else {
close();
closeAndGoToOpenOffers();
}
}
};
@ -947,6 +941,15 @@ public abstract class MutableOfferView<M extends MutableOfferViewModel<?>> exten
});
}
private void closeAndGoToOpenOffers() {
//go to open offers
UserThread.runAfter(() ->
navigation.navigateTo(MainView.class, PortfolioView.class,
OpenOffersView.class),
1, TimeUnit.SECONDS);
close();
}
private void setIsCurrencyForMakerFeeBtc(boolean isCurrencyForMakerFeeBtc) {
model.setIsCurrencyForMakerFeeBtc(isCurrencyForMakerFeeBtc);
if (DevEnv.isDaoActivated()) {

View file

@ -315,18 +315,12 @@ public class BsqSwapCreateOfferView extends BsqSwapOfferView<BsqSwapCreateOfferV
.feedback(Res.get("createOffer.success.info"))
.dontShowAgainId(key)
.actionButtonTextWithGoTo("navigation.portfolio.myOpenOffers")
.onAction(() -> {
UserThread.runAfter(() ->
navigation.navigateTo(MainView.class, PortfolioView.class,
OpenOffersView.class),
100, TimeUnit.MILLISECONDS);
close();
})
.onClose(this::close)
.onAction(this::closeAndGoToOpenOffers)
.onClose(this::closeAndGoToOpenOffers)
.show(),
100, TimeUnit.MILLISECONDS);
1, TimeUnit.SECONDS);
} else {
close();
closeAndGoToOpenOffers();
}
}
};
@ -608,4 +602,13 @@ public class BsqSwapCreateOfferView extends BsqSwapOfferView<BsqSwapCreateOfferV
.show();
}
}
private void closeAndGoToOpenOffers() {
//go to open offers
UserThread.runAfter(() ->
navigation.navigateTo(MainView.class, PortfolioView.class,
OpenOffersView.class),
1, TimeUnit.SECONDS);
close();
}
}