Skip to content

Commit

Permalink
Switch to open offers after creating a new offer
Browse files Browse the repository at this point in the history
  • Loading branch information
ripcurlx committed Apr 22, 2022
1 parent 4ce861a commit 389aeb9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 0 additions & 2 deletions core/src/main/resources/i18n/displayStrings.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down Expand Up @@ -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.
Expand Down
11 changes: 11 additions & 0 deletions desktop/src/main/java/bisq/desktop/main/offer/OfferView.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
import bisq.desktop.main.offer.offerbook.OtherOfferBookView;
import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookView;
import bisq.desktop.main.offer.offerbook.TopAltcoinOfferBookViewModel;
import bisq.desktop.main.portfolio.PortfolioView;
import bisq.desktop.main.portfolio.openoffer.OpenOffersView;
import bisq.desktop.util.GUIUtil;

import bisq.core.locale.CurrencyUtil;
Expand All @@ -48,12 +50,15 @@

import bisq.network.p2p.P2PService;

import bisq.common.UserThread;

import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;

import javafx.beans.value.ChangeListener;

import java.util.Optional;
import java.util.concurrent.TimeUnit;

import org.jetbrains.annotations.NotNull;

Expand Down Expand Up @@ -309,7 +314,13 @@ private void loadCreateViewClass(OfferBookView<?, ?> offerBookView,
((ClosableView) view).setCloseHandler(() -> {
offerBookView.enableCreateOfferButton();
((SelectableView) view).onTabSelected(false);
//reset tab
navigation.navigateTo(MainView.class, this.getClass(), viewClass);
//go to open offers
UserThread.runAfter(() ->
navigation.navigateTo(MainView.class, PortfolioView.class,
OpenOffersView.class),
100, TimeUnit.MILLISECONDS);
});


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.main.overlays.windows.OfferDetailsWindow;
import bisq.desktop.main.overlays.windows.QRCodeWindow;
import bisq.desktop.main.portfolio.PortfolioView;
import bisq.desktop.main.portfolio.openoffer.OpenOffersView;
import bisq.desktop.util.GUIUtil;
import bisq.desktop.util.Layout;

Expand Down Expand Up @@ -812,13 +810,7 @@ private void createListeners() {
.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();
})
.onAction(this::close)
.onClose(this::close)
.show(),
1);
Expand Down

0 comments on commit 389aeb9

Please sign in to comment.