Fix pending comments calculation in post list item (#7703)

#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

#### What this PR does / why we need it:

Fix pending comments calculation in post list item

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/7711/head
Ryan Wang 2025-08-19 15:03:16 +08:00 committed by GitHub
parent 157a8eb42d
commit 568ebf5b70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 15 deletions

View File

@ -38,11 +38,7 @@ const commentText = computed(() => {
comments: totalComment || 0,
});
if (!totalComment || !approvedComment) {
return text;
}
const pendingComments = totalComment - approvedComment;
const pendingComments = (totalComment || 0) - (approvedComment || 0);
if (pendingComments > 0) {
text += t("core.page.list.fields.comments-with-pending", {

View File

@ -39,11 +39,7 @@ const commentText = computed(() => {
comments: totalComment || 0,
});
if (!totalComment || !approvedComment) {
return text;
}
const pendingComments = totalComment - approvedComment;
const pendingComments = (totalComment || 0) - (approvedComment || 0);
if (pendingComments > 0) {
text += t("core.post.list.fields.comments-with-pending", {

View File

@ -48,11 +48,7 @@ const commentText = computed(() => {
comments: totalComment || 0,
});
if (!totalComment || !approvedComment) {
return text;
}
const pendingComments = totalComment - approvedComment;
const pendingComments = (totalComment || 0) - (approvedComment || 0);
if (pendingComments > 0) {
text += t(