Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant popup #4987

Merged
merged 1 commit into from
Dec 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -458,7 +458,6 @@ createOffer.tradeFee.fiatAndPercent=≈ {0} / {1} of trade amount

# new entries
createOffer.placeOfferButton=Review: Place offer to {0} bitcoin
createOffer.alreadyFunded=You had already funded that offer.\nYour funds have been moved to your local Bisq wallet and are available for withdrawal in the \"Funds/Send funds\" screen.
createOffer.createOfferFundWalletInfo.headline=Fund your offer
# suppress inspection "TrailingSpacesInProperty"
createOffer.createOfferFundWalletInfo.tradeAmount=- Trade amount: {0} \n
Expand Down Expand Up @@ -519,7 +518,6 @@ takeOffer.error.message=An error occurred when taking the offer.\n\n{0}
# new entries
takeOffer.takeOfferButton=Review: Take offer to {0} bitcoin
takeOffer.noPriceFeedAvailable=You cannot take that offer as it uses a percentage price based on the market price but there is no price feed available.
takeOffer.alreadyFunded.movedFunds=You had already funded that offer.\nYour funds have been moved to your local Bisq wallet and are available for withdrawal in the \"Funds/Send funds\" screen.
takeOffer.takeOfferFundWalletInfo.headline=Fund your trade
# suppress inspection "TrailingSpacesInProperty"
takeOffer.takeOfferFundWalletInfo.tradeAmount=- Trade amount: {0} \n
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@
import bisq.desktop.main.dao.DaoView;
import bisq.desktop.main.dao.wallet.BsqWalletView;
import bisq.desktop.main.dao.wallet.receive.BsqReceiveView;
import bisq.desktop.main.funds.FundsView;
import bisq.desktop.main.funds.withdrawal.WithdrawalView;
import bisq.desktop.main.overlays.notifications.Notification;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.main.overlays.windows.OfferDetailsWindow;
Expand Down Expand Up @@ -328,14 +326,6 @@ public void onClose() {
// we use model.placeOfferCompleted to not react on close which was triggered by a successful placeOffer
if (model.getDataModel().getBalance().get().isPositive() && !model.placeOfferCompleted.get()) {
model.getDataModel().swapTradeToSavings();
String key = "CreateOfferCancelAndFunded";
if (preferences.showAgain(key)) {
new Popup().information(Res.get("createOffer.alreadyFunded"))
.actionButtonTextWithGoTo("navigation.funds.availableForWithdrawal")
.onAction(() -> navigation.navigateTo(MainView.class, FundsView.class, WithdrawalView.class))
.dontShowAgainId(key)
.show();
}
}
}

Expand Down Expand Up @@ -1239,14 +1229,17 @@ private void addFundingGroup() {
fundingHBox.getChildren().add(cancelButton2);

cancelButton2.setOnAction(e -> {
if (model.getDataModel().getIsBtcWalletFunded().get()) {
new Popup().warning(Res.get("createOffer.warnCancelOffer"))
String key = "CreateOfferCancelAndFunded";
if (model.getDataModel().getIsBtcWalletFunded().get() &&
preferences.showAgain(key)) {
new Popup().backgroundInfo(Res.get("createOffer.warnCancelOffer"))
.closeButtonText(Res.get("shared.no"))
.actionButtonText(Res.get("shared.yesCancel"))
.onAction(() -> {
close();
model.getDataModel().swapTradeToSavings();
})
.dontShowAgainId(key)
.show();
} else {
close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class TakeOfferDataModel extends OfferDataModel {
private final User user;
private final FeeService feeService;
private final FilterManager filterManager;
private final Preferences preferences;
final Preferences preferences;
private final TxFeeEstimationService txFeeEstimationService;
private final PriceFeedService priceFeedService;
private final AccountAgeWitnessService accountAgeWitnessService;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -396,21 +396,12 @@ public void setCloseHandler(OfferView.CloseHandler closeHandler) {
this.closeHandler = closeHandler;
}

// called form parent as the view does not get notified when the tab is closed
// Called from parent as the view does not get notified when the tab is closed
public void onClose() {
Coin balance = model.dataModel.getBalance().get();
if (balance != null && balance.isPositive() && !model.takeOfferCompleted.get() && !DevEnv.isDevMode()) {
model.dataModel.swapTradeToSavings();
new Popup().information(Res.get("takeOffer.alreadyFunded.movedFunds"))
.actionButtonTextWithGoTo("navigation.funds.availableForWithdrawal")
.onAction(() -> navigation.navigateTo(MainView.class, FundsView.class, WithdrawalView.class))
.show();
}

// TODO need other implementation as it is displayed also if there are old funds in the wallet
/*
if (model.dataModel.getIsWalletFunded().get())
new Popup<>().warning("You have already funds paid in.\nIn the <Funds/Open for withdrawal> section you can withdraw those funds.").show();*/
}

public void onTabSelected(boolean isSelected) {
Expand Down Expand Up @@ -1034,14 +1025,17 @@ private void addFundingGroup() {
fundingHBox.getChildren().add(cancelButton2);

cancelButton2.setOnAction(e -> {
if (model.dataModel.getIsBtcWalletFunded().get()) {
new Popup().warning(Res.get("takeOffer.alreadyFunded.askCancel"))
String key = "CreateOfferCancelAndFunded";
if (model.dataModel.getIsBtcWalletFunded().get() &&
model.dataModel.preferences.showAgain(key)) {
new Popup().backgroundInfo(Res.get("takeOffer.alreadyFunded.askCancel"))
.closeButtonText(Res.get("shared.no"))
.actionButtonText(Res.get("shared.yesCancel"))
.onAction(() -> {
model.dataModel.swapTradeToSavings();
close();
close(false);
})
.dontShowAgainId(key)
.show();
} else {
close(false);
Expand Down