Default subreddit post sorting. Closes #166

This commit is contained in:
spikecodes 2021-03-25 21:41:58 -07:00
parent 2533e8cef5
commit 6a7f725c12
No known key found for this signature in database
GPG key ID: 004CECFF9B463BCB
6 changed files with 16 additions and 20 deletions

View file

@ -40,7 +40,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
#[cfg(debug_assertions)]
dbg!(req.param("id").unwrap_or_default());
let single_thread = &req.param("comment_id").is_some();
let single_thread = req.param("comment_id").is_some();
let highlighted_comment = &req.param("comment_id").unwrap_or_default();
// Send a request to the url, receive JSON in response
@ -57,7 +57,7 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
post,
sort,
prefs: Preferences::new(req),
single_thread: *single_thread,
single_thread,
})
}
// If the Reddit API returns an error, exit and send error page to user