mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: discussion: fix view counter
This commit is contained in:
1 parent
b3555e030f
commit
bbde2b9cda
2 files changed
+2
-2
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.14.13",
|
"version": "3.14.14",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -188,7 +188,7 @@ class DiscussionDetailHandler extends DiscussionHandler {
|
|||||||
reactions[drdoc._id.toHexString()] = reaction;
|
reactions[drdoc._id.toHexString()] = reaction;
|
||||||
})));
|
})));
|
||||||
const udict = await user.getList(domainId, uids);
|
const udict = await user.getList(domainId, uids);
|
||||||
if (!dsdoc?.view) {
|
if (!dsdoc?.view && this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
discussion.inc(domainId, did, 'views', 1),
|
discussion.inc(domainId, did, 'views', 1),
|
||||||
discussion.setStatus(domainId, did, this.user._id, { view: true }),
|
discussion.setStatus(domainId, did, this.user._id, { view: true }),
|
||||||
|
|||||||
Reference in new issue
Block a user