mirror of
https://github.com/bisq-network/bisq.git
synced 2025-02-22 22:45:21 +01:00
Show DAO news badge to increase visibility of DAO launch
This commit is contained in:
parent
24d0baeaa6
commit
b119c71a1c
3 changed files with 13 additions and 10 deletions
|
@ -34,9 +34,11 @@ import bisq.desktop.main.dao.news.NewsView;
|
|||
import bisq.desktop.main.dao.wallet.BsqWalletView;
|
||||
import bisq.desktop.main.dao.wallet.send.BsqSendView;
|
||||
import bisq.desktop.main.overlays.popups.Popup;
|
||||
import bisq.desktop.main.presentation.DaoPresentation;
|
||||
|
||||
import bisq.core.dao.governance.votereveal.VoteRevealService;
|
||||
import bisq.core.locale.Res;
|
||||
import bisq.core.user.Preferences;
|
||||
|
||||
import bisq.common.app.DevEnv;
|
||||
|
||||
|
@ -61,13 +63,16 @@ public class DaoView extends ActivatableViewAndModel<TabPane, Activatable> {
|
|||
|
||||
private final ViewLoader viewLoader;
|
||||
private final Navigation navigation;
|
||||
private Preferences preferences;
|
||||
private Tab selectedTab;
|
||||
private BsqWalletView bsqWalletView;
|
||||
|
||||
@Inject
|
||||
private DaoView(CachingViewLoader viewLoader, VoteRevealService voteRevealService, Navigation navigation) {
|
||||
private DaoView(CachingViewLoader viewLoader, VoteRevealService voteRevealService, Navigation navigation,
|
||||
Preferences preferences) {
|
||||
this.viewLoader = viewLoader;
|
||||
this.navigation = navigation;
|
||||
this.preferences = preferences;
|
||||
|
||||
voteRevealService.addVoteRevealTxPublishedListener(txId -> {
|
||||
new Popup<>().headLine(Res.get("dao.voteReveal.txPublished.headLine"))
|
||||
|
@ -140,6 +145,10 @@ public class DaoView extends ActivatableViewAndModel<TabPane, Activatable> {
|
|||
@Override
|
||||
protected void activate() {
|
||||
if (DevEnv.isDaoActivated()) {
|
||||
|
||||
// Hide dao new badge if user saw this section
|
||||
preferences.dontShowAgain(DaoPresentation.DAO_NEWS, true);
|
||||
|
||||
navigation.addListener(navigationListener);
|
||||
root.getSelectionModel().selectedItemProperty().addListener(tabChangeListener);
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import bisq.desktop.common.view.ActivatableView;
|
|||
import bisq.desktop.common.view.FxmlView;
|
||||
import bisq.desktop.components.BsqAddressTextField;
|
||||
import bisq.desktop.components.TitledGroupBg;
|
||||
import bisq.desktop.main.presentation.DaoPresentation;
|
||||
import bisq.desktop.util.GUIUtil;
|
||||
import bisq.desktop.util.Layout;
|
||||
|
||||
|
@ -13,7 +12,6 @@ import bisq.core.locale.Res;
|
|||
import bisq.core.user.Preferences;
|
||||
import bisq.core.util.BsqFormatter;
|
||||
|
||||
import bisq.common.app.DevEnv;
|
||||
import bisq.common.util.Tuple3;
|
||||
|
||||
import javax.inject.Inject;
|
||||
|
@ -158,10 +156,6 @@ public class NewsView extends ActivatableView<HBox, Void> {
|
|||
|
||||
@Override
|
||||
protected void activate() {
|
||||
// Hide dao new badge if user saw this page
|
||||
if (!DevEnv.isDaoActivated())
|
||||
preferences.dontShowAgain(DaoPresentation.DAO_NEWS, true);
|
||||
|
||||
addressTextField.setAddress(bsqFormatter.getBsqAddressStringFromAddress(bsqWalletService.getUnusedAddress()));
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import lombok.Getter;
|
|||
|
||||
public class DaoPresentation implements DaoStateListener {
|
||||
|
||||
public static final String DAO_NEWS = "daoNewsVersion0.9.4";
|
||||
public static final String DAO_NEWS = "daoNewsVersion1.0.0";
|
||||
|
||||
private final Preferences preferences;
|
||||
private final BtcWalletService btcWalletService;
|
||||
|
@ -56,7 +56,7 @@ public class DaoPresentation implements DaoStateListener {
|
|||
this.daoStateService = daoStateService;
|
||||
|
||||
preferences.getDontShowAgainMapAsObservable().addListener((MapChangeListener<? super String, ? super Boolean>) change -> {
|
||||
if (change.getKey().equals(DAO_NEWS) && !DevEnv.isDaoActivated()) {
|
||||
if (change.getKey().equals(DAO_NEWS) && DevEnv.isDaoActivated()) {
|
||||
showNotification.set(!change.wasAdded());
|
||||
}
|
||||
});
|
||||
|
@ -115,7 +115,7 @@ public class DaoPresentation implements DaoStateListener {
|
|||
}
|
||||
|
||||
public void setup() {
|
||||
if (!DevEnv.isDaoActivated())
|
||||
if (DevEnv.isDaoActivated())
|
||||
showNotification.set(preferences.showAgain(DAO_NEWS));
|
||||
|
||||
this.btcWalletService.getChainHeightProperty().addListener(walletChainHeightListener);
|
||||
|
|
Loading…
Add table
Reference in a new issue