-
Notifications
You must be signed in to change notification settings - Fork 169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restore legacy 'Show Scores' option #1544
Restore legacy 'Show Scores' option #1544
Conversation
This also means show_scores was reset to false for pre 0.19.4 versions. As it used the wrong option. If users saved their settings in the meantime |
@@ -144,52 +146,58 @@ fun ScoreAndTime( | |||
downvotes = instantScores.downvotes, | |||
) | |||
|
|||
// If the show_scores is disabled, and we are the instance is pre 0.19.4, we fallback to legacy behaviour | |||
val version = API.getInstanceOrNull()?.version | |||
val legacyScoresHidden = version != null && version < Version(0, 19, 4) && !voteDisplayMode.score |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can probably just use the !api.FF.hidePost()
like in the other files, to denote that its before 0.19.4
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes
if (voteDisplayMode.score || voteDisplayMode.upvotes || voteDisplayMode.downvotes || voteDisplayMode.upvote_percentage) { | ||
DotSpacer(style = MaterialTheme.typography.labelMedium) | ||
if (!legacyScoresHidden) { | ||
if (voteDisplayMode.score && !hideScore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just move !legacyScoresHidden into this if statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so? It's previous behaviour was to hide all "voting types" , total, upvotes/downvotes. Current is to hide only scores. So to match previous behaviour this is necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh my bad.
if (voteDisplayMode.score || voteDisplayMode.upvotes || voteDisplayMode.downvotes || voteDisplayMode.upvote_percentage) { | ||
DotSpacer(style = MaterialTheme.typography.labelMedium) | ||
if (!legacyScoresHidden) { | ||
if (voteDisplayMode.score && !hideScore) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ohh my bad.
The legacy 'Show Scores' option was removed, this restores it.
This also fixes missing scores in listing view mode mode for pre 0.19.4 instances