mirror of
				https://github.com/NodeBB/NodeBB.git
				synced 2025-10-31 11:05:54 +01:00 
			
		
		
		
	fix: bookmark in topic data is nullable now
This prevents the superfluous "/1" being appended to all topics you've never been into. This looks to be a change in the public API but the documented API lists this property as nullable already, so it looks like this commit is actually *restoring* proper behaviour.
This commit is contained in:
		| @@ -138,9 +138,9 @@ Topics.getTopicsByTids = async function (tids, options) { | |||||||
| 			topic.isOwner = topic.uid === parseInt(uid, 10); | 			topic.isOwner = topic.uid === parseInt(uid, 10); | ||||||
| 			topic.ignored = isIgnored[i]; | 			topic.ignored = isIgnored[i]; | ||||||
| 			topic.unread = parseInt(uid, 10) <= 0 || (!hasRead[i] && !isIgnored[i]); | 			topic.unread = parseInt(uid, 10) <= 0 || (!hasRead[i] && !isIgnored[i]); | ||||||
| 			topic.bookmark = sortNewToOld ? | 			topic.bookmark = bookmarks[i] && (sortNewToOld ? | ||||||
| 				Math.max(1, topic.postcount + 2 - bookmarks[i]) : | 				Math.max(1, topic.postcount + 2 - bookmarks[i]) : | ||||||
| 				Math.min(topic.postcount, bookmarks[i] + 1); | 				Math.min(topic.postcount, bookmarks[i] + 1)); | ||||||
| 			topic.unreplied = !topic.teaser; | 			topic.unreplied = !topic.teaser; | ||||||
|  |  | ||||||
| 			topic.icons = []; | 			topic.icons = []; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user