mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-07-01 11:40:33 +00:00
move line
This commit is contained in:
parent
16c7994023
commit
ada5f8be5d
|
@ -220,11 +220,6 @@ fn queries<'a>() -> Queries<
|
|||
query = query.filter(person_block::person_id.is_null());
|
||||
}
|
||||
|
||||
// distinguished comments should go first when viewing post
|
||||
if options.post_id.is_some() || options.parent_path.is_some() {
|
||||
query = query.order_by(comment::distinguished.desc());
|
||||
}
|
||||
|
||||
// A Max depth given means its a tree fetch
|
||||
let (limit, offset) = if let Some(max_depth) = options.max_depth {
|
||||
let depth_limit = if let Some(parent_path) = options.parent_path.as_ref() {
|
||||
|
@ -258,6 +253,11 @@ fn queries<'a>() -> Queries<
|
|||
limit_and_offset(options.page, options.limit)?
|
||||
};
|
||||
|
||||
// distinguished comments should go first when viewing post
|
||||
if options.post_id.is_some() || options.parent_path.is_some() {
|
||||
query = query.order_by(comment::distinguished.desc());
|
||||
}
|
||||
|
||||
query = match options.sort.unwrap_or(CommentSortType::Hot) {
|
||||
CommentSortType::Hot => query
|
||||
.then_order_by(comment_aggregates::hot_rank.desc())
|
||||
|
|
Loading…
Reference in a new issue