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

Only show XMR subaddress recommendation if the user has a XMR account setup #7123

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
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import bisq.core.locale.Res;
import bisq.core.user.DontShowAgainLookup;

import bisq.common.app.DevEnv;
import bisq.common.util.Utilities;

import javax.inject.Inject;
Expand Down Expand Up @@ -273,14 +272,6 @@ else if (root.getSelectionModel().getSelectedItem() == backupTab)
.backgroundInfo(Res.get("account.info.msg"))
.dontShowAgainId(key)
.show();
} else {
// news badge leads to the XMR subaddress info page (added in v1.9.2)
new Popup()
.headLine(Res.get("account.altcoin.popup.xmr.dataDirWarningHeadline"))
.backgroundInfo(Res.get("account.altcoin.popup.xmr.dataDirWarning"))
.dontShowAgainId("accountSubAddressInfo")
.width(700)
.show();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
package bisq.desktop.main.account.content.altcoinaccounts;

import bisq.desktop.common.model.ActivatableDataModel;
import bisq.desktop.main.overlays.popups.Popup;
import bisq.desktop.util.GUIUtil;

import bisq.core.locale.CryptoCurrency;
import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
import bisq.core.offer.OpenOfferManager;
import bisq.core.payment.AssetAccount;
Expand Down Expand Up @@ -76,6 +78,16 @@ public AltCoinAccountsDataModel(User user,
protected void activate() {
user.getPaymentAccountsAsObservable().addListener(setChangeListener);
fillAndSortPaymentAccounts();

paymentAccounts.stream().filter(e -> e.getSingleTradeCurrency().getCode().equals("XMR"))
.findAny().ifPresent(e -> {
new Popup()
.headLine(Res.get("account.altcoin.popup.xmr.dataDirWarningHeadline"))
.backgroundInfo(Res.get("account.altcoin.popup.xmr.dataDirWarning"))
.dontShowAgainId("accountSubAddressInfo")
.width(700)
.show();
});
}

private void fillAndSortPaymentAccounts() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ public AccountPresentation(Preferences preferences) {

preferences.getDontShowAgainMapAsObservable().addListener((MapChangeListener<? super String, ? super Boolean>) change -> {
if (change.getKey().equals(ACCOUNT_NEWS)) {
showNotification.set(!change.wasAdded());
// devs enable this when a news badge is required
// showNotification.set(!change.wasAdded());
showNotification.set(false);
}
});
}
Expand All @@ -65,26 +67,26 @@ public BooleanProperty getShowAccountUpdatesNotification() {

public void setup() {
// devs enable this when a news badge is required
showNotification.set(preferences.showAgain(ACCOUNT_NEWS));
//showNotification.set(preferences.showAgain(ACCOUNT_NEWS));
showNotification.set(false);
}

public void showOneTimeAccountSigningPopup(String key, String s) {
showOneTimeAccountSigningPopup(key, s, null);
public void showOneTimeAccountSigningPopup(String key, String message) {
showOneTimeAccountSigningPopup(key, message, null);
}

public void showOneTimeAccountSigningPopup(String key, String s, String optionalParam) {
public void showOneTimeAccountSigningPopup(String key, String message, String optionalParam) {
if (!DevEnv.isDevMode()) {

DontShowAgainLookup.dontShowAgain(ACCOUNT_NEWS, false);
showNotification.set(true);

DontShowAgainLookup.dontShowAgain(key, true);
String message = optionalParam != null ?
Res.get(s, optionalParam, Res.get("popup.accountSigning.generalInformation")) :
Res.get(s, Res.get("popup.accountSigning.generalInformation"));
String information = optionalParam != null ?
Res.get(message, optionalParam, Res.get("popup.accountSigning.generalInformation")) :
Res.get(message, Res.get("popup.accountSigning.generalInformation"));

new Popup().information(message)
.show();
new Popup().information(information).show();
}
}
}
Loading