Skip to content

Commit

Permalink
Use a new key for settings badge.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jmacxx committed Mar 3, 2022
1 parent 327ea68 commit 8fa44d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -43,7 +43,7 @@ public SettingsPresentation(Preferences preferences) {
this.preferences = preferences;

preferences.getDontShowAgainMapAsObservable().addListener((MapChangeListener<? super String, ? super Boolean>) change -> {
if (change.getKey().equals(SETTINGS_NEWS)) {
if (change.getKey().equals(SETTINGS_BADGE_KEY)) {
showNotification.set(!change.wasAdded());
}
});
Expand All @@ -58,6 +58,6 @@ public BooleanProperty getShowSettingsUpdatesNotification() {
}

public void setup() {
showNotification.set(preferences.showAgain(SETTINGS_NEWS));
showNotification.set(preferences.showAgain(SETTINGS_BADGE_KEY));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8fa44d7

Please sign in to comment.