File tree 2 files changed +12
-4
lines changed
Simplenote/src/main/java/com/automattic/simplenote
2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -243,10 +243,8 @@ public boolean onPreferenceClick(Preference preference) {
243
243
244
244
final SwitchPreferenceCompat sustainerIconPreference = findPreference ("pref_key_sustainer_icon" );
245
245
try {
246
- if (
247
- mPreferencesBucket .get (PREFERENCES_OBJECT_KEY ).getCurrentSubscriptionPlatform () != null &&
248
- Build .VERSION .SDK_INT >= Build .VERSION_CODES .P
249
- ) {
246
+ boolean wasSustainer = mPreferencesBucket .get (PREFERENCES_OBJECT_KEY ).getWasSustainer ();
247
+ if (wasSustainer && Build .VERSION .SDK_INT >= Build .VERSION_CODES .P ) {
250
248
sustainerIconPreference .setVisible (true );
251
249
sustainerIconPreference .setOnPreferenceChangeListener ((preference , newValue ) -> {
252
250
toggleSustainerAppIcon ((boolean ) newValue );
Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ public class Preferences extends BucketObject {
19
19
private static final String SUBSCRIPTION_LEVEL_KEY = "subscription_level" ;
20
20
private static final String SUBSCRIPTION_PLATFORM_KEY = "subscription_platform" ;
21
21
private static final String SUBSCRIPTION_DATE_KEY = "subscription_date" ;
22
+ private static final String WAS_SUSTAINER_KEY = "was_sustainer" ;
22
23
23
24
private Preferences (String key , JSONObject properties ) {
24
25
super (key , properties );
@@ -115,6 +116,15 @@ public void setSubscriptionLevel(SubscriptionLevel subscriptionLevel) {
115
116
setProperty (SUBSCRIPTION_LEVEL_KEY , subscriptionLevel .getName ());
116
117
}
117
118
119
+ public boolean getWasSustainer () {
120
+ Object wasSustainer = getProperty (WAS_SUSTAINER_KEY );
121
+ if (wasSustainer == null ) {
122
+ return false ;
123
+ }
124
+
125
+ return (Boolean )getProperty (WAS_SUSTAINER_KEY );
126
+ }
127
+
118
128
public static class Schema extends BucketSchema <Preferences > {
119
129
120
130
public Schema () {
You can’t perform that action at this time.
0 commit comments