mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 19:15:58 +01:00 
			
		
		
		
	fix: check threshold before setting bookmark
This commit is contained in:
		| @@ -53,7 +53,10 @@ SocketTopics.bookmark = async function (socket, data) { | |||||||
| 	if (!socket.uid || !data) { | 	if (!socket.uid || !data) { | ||||||
| 		throw new Error('[[error:invalid-data]]'); | 		throw new Error('[[error:invalid-data]]'); | ||||||
| 	} | 	} | ||||||
| 	await topics.setUserBookmark(data.tid, socket.uid, data.index); | 	const postcount = await topics.getTopicField(data.tid, 'postcount'); | ||||||
|  | 	if (data.index > meta.config.bookmarkThreshold && postcount > meta.config.bookmarkThreshold) { | ||||||
|  | 		await topics.setUserBookmark(data.tid, socket.uid, data.index); | ||||||
|  | 	} | ||||||
| }; | }; | ||||||
|  |  | ||||||
| SocketTopics.createTopicFromPosts = async function (socket, data) { | SocketTopics.createTopicFromPosts = async function (socket, data) { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user