fix(popular threads box): default to worksafe content and show 8 posts for single subplebbit

This commit is contained in:
Tom (plebeius.eth)
2024-06-12 16:50:39 +02:00
parent f20a5f21f9
commit c6a1283b56
3 changed files with 3 additions and 9 deletions
+1 -8
View File
@@ -9,14 +9,7 @@ const usePopularPosts = (subplebbits: Subplebbit[]) => {
const uniqueLinks: Set<string> = new Set();
const allPosts: Comment[] = [];
let postsPerSub = 1;
if (subplebbits.length === 2) {
postsPerSub = 4;
} else if (subplebbits.length === 3) {
postsPerSub = 3;
} else if (subplebbits.length >= 4 && subplebbits.length < 8) {
postsPerSub = 2;
}
const postsPerSub = [0, 8, 4, 3, 2, 2, 2, 2, 1][Math.min(subplebbits.length, 8)];
subplebbits.forEach((subplebbit: any) => {
let subplebbitPosts: Comment[] = [];