From 8fa44d7bfe9c12696d1017ecf53ff427ea78df51 Mon Sep 17 00:00:00 2001 From: jmacxx <47253594+jmacxx@users.noreply.github.com> Date: Thu, 3 Mar 2022 07:44:08 -0600 Subject: [PATCH] Use a new key for settings badge. Rename the key constant variable to SETTINGS_BADGE_KEY to clarify that its value should be different each time it is used for a new feature. Use a key which describes the new feature being promoted. --- .../desktop/main/presentation/SettingsPresentation.java | 6 +++--- .../main/java/bisq/desktop/main/settings/SettingsView.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/desktop/src/main/java/bisq/desktop/main/presentation/SettingsPresentation.java b/desktop/src/main/java/bisq/desktop/main/presentation/SettingsPresentation.java index 73508b05386..f1eab5c2f9a 100644 --- a/desktop/src/main/java/bisq/desktop/main/presentation/SettingsPresentation.java +++ b/desktop/src/main/java/bisq/desktop/main/presentation/SettingsPresentation.java @@ -31,7 +31,7 @@ @Singleton public class SettingsPresentation { - public static final String SETTINGS_NEWS = "settingsNews"; + public static final String SETTINGS_BADGE_KEY = "settingsPrivacyFeature"; private Preferences preferences; @@ -43,7 +43,7 @@ public SettingsPresentation(Preferences preferences) { this.preferences = preferences; preferences.getDontShowAgainMapAsObservable().addListener((MapChangeListener) change -> { - if (change.getKey().equals(SETTINGS_NEWS)) { + if (change.getKey().equals(SETTINGS_BADGE_KEY)) { showNotification.set(!change.wasAdded()); } }); @@ -58,6 +58,6 @@ public BooleanProperty getShowSettingsUpdatesNotification() { } public void setup() { - showNotification.set(preferences.showAgain(SETTINGS_NEWS)); + showNotification.set(preferences.showAgain(SETTINGS_BADGE_KEY)); } } diff --git a/desktop/src/main/java/bisq/desktop/main/settings/SettingsView.java b/desktop/src/main/java/bisq/desktop/main/settings/SettingsView.java index 440bd58d20a..771df416cd1 100644 --- a/desktop/src/main/java/bisq/desktop/main/settings/SettingsView.java +++ b/desktop/src/main/java/bisq/desktop/main/settings/SettingsView.java @@ -89,7 +89,7 @@ else if (newValue == aboutTab) @Override protected void activate() { // Hide new badge if user saw this section - preferences.dontShowAgain(SettingsPresentation.SETTINGS_NEWS, true); + preferences.dontShowAgain(SettingsPresentation.SETTINGS_BADGE_KEY, true); root.getSelectionModel().selectedItemProperty().addListener(tabChangeListener); navigation.addListener(navigationListener);