Skip to content

Commit b8bd067

Browse files
authored
chore: use creation time instead of approved time. (halo-dev#32)
#### What type of PR is this? /kind improvement #### What this PR does / why we need it: 使用创建时间代替审核时间 #### Which issue(s) this PR fixes: Fixes halo-dev/halo#3915 #### Special notes for your reviewer: 1. 安装可测试插件 [plugin-comment-widget-1.5.0-SNAPSHOT.jar.zip](https://github.com/halo-sigs/plugin-comment-widget/files/11450596/plugin-comment-widget-1.5.0-SNAPSHOT.jar.zip) 2. console 端开启评论审核 3. 发起一个评论并等待一段时间前往 console 端进行审核 4. 查看界面评论时间是否为创建时间而非审核通过时间 #### Does this PR introduce a user-facing change? ```release-note 使用创建时间替代审核时间 ```
1 parent 8b3c160 commit b8bd067

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/comment-widget/src/components/CommentItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const hoveredReply = ref<ReplyVo>();
4141
provide<Ref<ReplyVo | undefined>>("hoveredReply", hoveredReply);
4242
4343
const timeAgo = useTimeAgo(
44-
new Date(props.comment?.spec.approvedTime || new Date())
44+
new Date(props.comment?.spec.creationTime || new Date())
4545
);
4646
4747
const isAuthor = computed(() => {

packages/comment-widget/src/components/ReplyItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const emit = defineEmits<{
2222
const showForm = ref(false);
2323
2424
const timeAgo = useTimeAgo(
25-
new Date(props.reply.spec.approvedTime || new Date())
25+
new Date(props.reply.spec.creationTime || new Date())
2626
);
2727
2828
const website = computed(() => {

src/main/resources/static/comment-widget.iife.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)