From e65944ceb0207044081cc94220c2ba2a53673c74 Mon Sep 17 00:00:00 2001 From: Alex Ning Date: Thu, 8 Apr 2021 23:14:50 +0800 Subject: Don't reset disable nsfw forever option when resetting all settings. --- .../infinityforreddit/settings/AdvancedPreferenceFragment.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/src/main/java') diff --git a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java index 2f07f10b..f133863d 100644 --- a/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java +++ b/app/src/main/java/ml/docilealligator/infinityforreddit/settings/AdvancedPreferenceFragment.java @@ -258,10 +258,15 @@ public class AdvancedPreferenceFragment extends PreferenceFragmentCompat { .setTitle(R.string.are_you_sure) .setPositiveButton(R.string.yes, (dialogInterface, i) -> { + boolean disableNsfwForever = mSharedPreferences.getBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, false); mSharedPreferences.edit().clear().apply(); mainActivityTabsSharedPreferences.edit().clear().apply(); nsfwAndBlurringSharedPreferences.edit().clear().apply(); + if (disableNsfwForever) { + mSharedPreferences.edit().putBoolean(SharedPreferencesUtils.DISABLE_NSFW_FOREVER, true).apply(); + } + Toast.makeText(activity, R.string.reset_all_settings_success, Toast.LENGTH_SHORT).show(); EventBus.getDefault().post(new RecreateActivityEvent()); }) -- cgit v1.2.3