From 8fcf3ecca2b1bebdff11135b6a33f50f4382d489 Mon Sep 17 00:00:00 2001 From: xing Date: Thu, 4 Jan 2024 23:36:00 +0800 Subject: [PATCH] fix bug --- app/theme/wp/comments.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/theme/wp/comments.go b/app/theme/wp/comments.go index 6129f8c..44441f4 100644 --- a/app/theme/wp/comments.go +++ b/app/theme/wp/comments.go @@ -50,9 +50,6 @@ func (c CommentHandle) findComments(ctx context.Context, timeout time.Duration, return t, len(t) > 0 }) if len(rr) < 1 { - slice.Sort(comments, func(i, j models.Comments) bool { - return c.html.FloorOrder(c.order, i, j) - }) return comments, nil } ids := slice.Decompress(rr) @@ -65,6 +62,9 @@ func (c CommentHandle) findComments(ctx context.Context, timeout time.Duration, return nil, err } comments = append(comments, rrr...) + slice.Sort(comments, func(i, j models.Comments) bool { + return c.html.FloorOrder(c.order, i, j) + }) return comments, nil }