Don't reset disable nsfw forever option when resetting all settings.

This commit is contained in:
Alex Ning 2021-04-08 23:14:50 +08:00
parent 270f891761
commit e65944ceb0

View File

@ -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());
})