Fix unintended [mismatched] show-replies preference (with key force-reset) (#2568)

* Fix unintended [mismatched] show-replies preference and add a comment to prevent confusion.

* Change the key on TAB_FILTER_HOME_REPLIES to reset everyone's value here once.
This commit is contained in:
mcclure 2022-05-29 13:21:33 -04:00 committed by GitHub
parent d2befa83d3
commit 06e32f703a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View file

@ -39,7 +39,7 @@ class TabFilterPreferencesFragment : PreferenceFragmentCompat() {
checkBoxPreference { checkBoxPreference {
setTitle(R.string.pref_title_show_replies) setTitle(R.string.pref_title_show_replies)
key = PrefKeys.TAB_FILTER_HOME_REPLIES key = PrefKeys.TAB_FILTER_HOME_REPLIES
setDefaultValue(false) setDefaultValue(true)
isIconSpaceReserved = false isIconSpaceReserved = false
} }
} }

View file

@ -81,6 +81,7 @@ abstract class TimelineViewModel(
this.tags = tags this.tags = tags
if (kind == Kind.HOME) { if (kind == Kind.HOME) {
// Note the variable is "true if filter" but the underlying preference/settings text is "true if show"
filterRemoveReplies = filterRemoveReplies =
!sharedPreferences.getBoolean(PrefKeys.TAB_FILTER_HOME_REPLIES, true) !sharedPreferences.getBoolean(PrefKeys.TAB_FILTER_HOME_REPLIES, true)
filterRemoveReblogs = filterRemoveReblogs =

View file

@ -62,6 +62,6 @@ object PrefKeys {
const val NOTIFICATION_FILTER_SIGN_UPS = "notificationFilterSignUps" const val NOTIFICATION_FILTER_SIGN_UPS = "notificationFilterSignUps"
const val NOTIFICATION_FILTER_UPDATES = "notificationFilterUpdates" const val NOTIFICATION_FILTER_UPDATES = "notificationFilterUpdates"
const val TAB_FILTER_HOME_REPLIES = "tabFilterHomeReplies" const val TAB_FILTER_HOME_REPLIES = "tabFilterHomeReplies_v2" // This was changed once to reset an unintentionally set default.
const val TAB_FILTER_HOME_BOOSTS = "tabFilterHomeBoosts" const val TAB_FILTER_HOME_BOOSTS = "tabFilterHomeBoosts"
} }