Fix multireddit sidebars

This commit is contained in:
spikecodes 2021-01-30 20:24:09 -08:00
parent 21d96e261f
commit 8c80946121
No known key found for this signature in database
GPG Key ID: 004CECFF9B463BCB

View File

@ -52,18 +52,19 @@ pub async fn page(req: HttpRequest) -> HttpResponse {
let sub = if !sub.contains('+') && sub != subscribed && sub != "popular" && sub != "all" {
// Regular subreddit
subreddit(&sub).await.unwrap_or_default()
} else if sub == subscribed {
// Subscription feed
if req.path().starts_with("/r/") {
subreddit(&sub).await.unwrap_or_default()
} else {
Subreddit::default()
}
} else if sub.contains('+') {
// Multireddit
Subreddit {
name: sub,
..Subreddit::default()
}
} else if sub == subscribed {
if req.path().starts_with("/r/") {
subreddit(&sub).await.unwrap_or_default()
} else {
Subreddit::default()
}
} else {
Subreddit::default()
};