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>
This commit is contained in:
Nick Lowery 2022-03-14 21:39:39 -06:00 committed by GitHub
parent 3eef60d486
commit f0a6bdc21b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 7 deletions

View File

@ -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"

View File

@ -87,14 +87,12 @@ pub async fn community(req: Request<Body>) -> Result<Response<Body>, 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());

View File

@ -74,12 +74,12 @@
</footer>
</div>
{% endif %}
{% if is_filtered || (!sub.name.is_empty() && !sub.name.contains("+")) %}
{% if is_filtered || (sub.name != "all" && sub.name != "popular" && !sub.name.contains("+")) %}
<aside>
{% if is_filtered %}
<center>(Content from r/{{ sub.name }} has been filtered)</center>
{% endif %}
{% if !sub.name.is_empty() && !sub.name.contains("+") %}
{% if sub.name != "all" && sub.name != "popular" && !sub.name.contains("+") %}
<div class="panel" id="subreddit">
{% if sub.wiki %}
<div id="top">