Skip to content

Node.js based forum software built for the modern web

fix: properly incase its the same path

Barış Soner Uşaklı807b0d434870
diff --git a/src/topics/thumbs.js b/src/topics/thumbs.js
index 0b079b9d98..2e40bf4ae9 100644
--- a/src/topics/thumbs.js
+++ b/src/topics/thumbs.js
@@ -81,7 +81,8 @@ Thumbs.associate = async function ({ id, path }) {
const topics = require('.');
await db.sortedSetAdd(set, numThumbs, path);
if (!isDraft) {
- await topics.setTopicField(id, 'numThumbs', numThumbs + 1);
+ const numThumbs = await db.sortedSetCard(set);
+ await topics.setTopicField(id, 'numThumbs', numThumbs);
}
cache.del(set);