Skip to content
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

Merged
merged 5 commits into from
Jun 13, 2024

Conversation

MV-GH
Copy link
Collaborator

@MV-GH MV-GH commented Jun 9, 2024

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

@MV-GH MV-GH requested a review from dessalines as a code owner June 9, 2024 20:22
@MV-GH
Copy link
Collaborator Author

MV-GH commented Jun 9, 2024

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
Copy link
Member

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

Copy link
Collaborator Author

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) {
Copy link
Member

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.

Copy link
Collaborator Author

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

Copy link
Member

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ohh my bad.

@dessalines dessalines merged commit f62c4e9 into LemmyNet:main Jun 13, 2024
1 check passed
@MV-GH MV-GH deleted the restore_legacy_show_scores_option branch June 13, 2024 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants