From f0a6bdc21b85cc5b68e1ff2741f32bb30cf3b5bf Mon Sep 17 00:00:00 2001 From: Nick Lowery Date: Mon, 14 Mar 2022 21:39:39 -0600 Subject: [PATCH] Fix sorting buttons on r/all and r/popular (#402) * Fix sorting buttons on r/all and r/popular * Bump version to v0.22.2 * Fix empty sidebar in r/all and r/popular Co-authored-by: spikecodes <19519553+spikecodes@users.noreply.github.com> --- Cargo.toml | 2 +- src/subreddit.rs | 6 ++---- templates/subreddit.html | 4 ++-- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e7f1901..729e22c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "libreddit" description = " Alternative private front-end to Reddit" license = "AGPL-3.0" repository = "https://github.com/spikecodes/libreddit" -version = "0.22.1" +version = "0.22.2" authors = ["spikecodes <19519553+spikecodes@users.noreply.github.com>"] edition = "2021" diff --git a/src/subreddit.rs b/src/subreddit.rs index 119ba65..dde8fb8 100644 --- a/src/subreddit.rs +++ b/src/subreddit.rs @@ -87,14 +87,12 @@ pub async fn community(req: Request) -> Result, String> { } else { Subreddit::default() } - } else if sub_name.contains('+') { - // Multireddit + } else { + // Multireddit, all, popular Subreddit { name: sub_name.clone(), ..Subreddit::default() } - } else { - Subreddit::default() }; let path = format!("/r/{}/{}.json?{}&raw_json=1", sub_name.clone(), sort, req.uri().query().unwrap_or_default()); diff --git a/templates/subreddit.html b/templates/subreddit.html index 764c63e..f569bb7 100644 --- a/templates/subreddit.html +++ b/templates/subreddit.html @@ -74,12 +74,12 @@ {% endif %} - {% if is_filtered || (!sub.name.is_empty() && !sub.name.contains("+")) %} + {% if is_filtered || (sub.name != "all" && sub.name != "popular" && !sub.name.contains("+")) %}