From a3aba941021a2b424d5112481d9a4f7cd2853044 Mon Sep 17 00:00:00 2001 From: guqing <38999863+guqing@users.noreply.github.com> Date: Fri, 30 Sep 2022 10:22:19 +0800 Subject: [PATCH] refactor: comment hidden default is false (#2482) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind improvement /area core /milestone 2.0 #### What this PR does / why we need it: 创建评论时 hidden 字段默认为 false #### Which issue(s) this PR fixes: Fixes # #### Special notes for your reviewer: /cc @halo-dev/sig-halo #### Does this PR introduce a user-facing change? ```release-note None ``` --- .../java/run/halo/app/content/comment/CommentServiceImpl.java | 2 +- .../run/halo/app/content/comment/CommentServiceImplTest.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java b/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java index e2a2cd335..146c273d2 100644 --- a/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java +++ b/src/main/java/run/halo/app/content/comment/CommentServiceImpl.java @@ -81,7 +81,7 @@ public class CommentServiceImpl implements CommentService { } comment.getSpec() .setApproved(Boolean.FALSE.equals(commentSetting.getRequireReviewForNew())); - comment.getSpec().setHidden(!comment.getSpec().getApproved()); + comment.getSpec().setHidden(false); if (comment.getSpec().getOwner() != null) { return Mono.just(comment); } diff --git a/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java b/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java index e95d9c67a..fe6a9bfed 100644 --- a/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java +++ b/src/test/java/run/halo/app/content/comment/CommentServiceImplTest.java @@ -141,7 +141,7 @@ class CommentServiceImplTest { "top": false, "allowNotification": true, "approved": false, - "hidden": true, + "hidden": false, "subjectRef": { "group": "content.halo.run", "version": "v1alpha1",