core: discussion: fix view counter

This commit is contained in:
undefined committed 2022-07-19 14:29:03 +08:00
1 parent b3555e030f
commit bbde2b9cda
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "3.14.13",
"version": "3.14.14",
"bin": "bin/hydrooj.js",
"main": "src/loader",
"module": "src/loader",
+1 -1
View File
@@ -188,7 +188,7 @@ class DiscussionDetailHandler extends DiscussionHandler {
reactions[drdoc._id.toHexString()] = reaction;
})));
const udict = await user.getList(domainId, uids);
if (!dsdoc?.view) {
if (!dsdoc?.view && this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
await Promise.all([
discussion.inc(domainId, did, 'views', 1),
discussion.setStatus(domainId, did, this.user._id, { view: true }),