mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 02:55:58 +01:00 
			
		
		
		
	Squashed commit of the following:
commit4e0e792232Merge:24d0999fb570b4a0e2aeAuthor: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Fri Jun 7 19:26:49 2024 -0400 Merge branch 'master' into develop commit70b4a0e2aeAuthor: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Fri Jun 7 19:14:13 2024 -0400 feat: allow passing min,max to sortedSetsCardSum to get rid of multiple db calls in profile page commit6bbe3d1c4cAuthor: Barış Soner Uşaklı <barisusakli@gmail.com> Date: Fri Jun 7 14:08:48 2024 -0400 fix: dont show error alert when user user mouse overs votes if they dont have permission to view votes commit24d0999fb5Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu Jun 6 13:49:14 2024 -0400 fix(deps): update dependency pg-cursor to v2.11.0 (#12617) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> commitbee05fe212Author: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Date: Thu Jun 6 13:28:59 2024 -0400 fix(deps): update dependency pg to v8.12.0 (#12616) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This commit is contained in:
		| @@ -190,8 +190,8 @@ async function getCounts(userData, callerUID) { | ||||
| 	const cids = await categories.getCidsByPrivilege('categories:cid', callerUID, 'topics:read'); | ||||
| 	const promises = { | ||||
| 		posts: db.sortedSetsCardSum(cids.map(c => `cid:${c}:uid:${uid}:pids`)), | ||||
| 		best: Promise.all(cids.map(async c => db.sortedSetCount(`cid:${c}:uid:${uid}:pids:votes`, 1, '+inf'))), | ||||
| 		controversial: Promise.all(cids.map(async c => db.sortedSetCount(`cid:${c}:uid:${uid}:pids:votes`, '-inf', -1))), | ||||
| 		best: db.sortedSetsCardSum(cids.map(c => `cid:${c}:uid:${uid}:pids:votes`), 1, '+inf'), | ||||
| 		controversial: db.sortedSetsCardSum(cids.map(c => `cid:${c}:uid:${uid}:pids:votes`), '-inf', -1), | ||||
| 		topics: db.sortedSetsCardSum(cids.map(c => `cid:${c}:uid:${uid}:tids`)), | ||||
| 	}; | ||||
| 	if (userData.isAdmin || userData.isSelf) { | ||||
| @@ -207,8 +207,6 @@ async function getCounts(userData, callerUID) { | ||||
| 	} | ||||
| 	const counts = await utils.promiseParallel(promises); | ||||
| 	counts.posts = isRemote ? userData.postcount : counts.posts; | ||||
| 	counts.best = counts.best.reduce((sum, count) => sum + count, 0); | ||||
| 	counts.controversial = counts.controversial.reduce((sum, count) => sum + count, 0); | ||||
| 	counts.categoriesWatched = counts.categoriesWatched && counts.categoriesWatched.length; | ||||
| 	counts.groups = userData.groups.length; | ||||
| 	counts.following = userData.followingCount; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user