Compare commits

..

No commits in common. "555601c7de8ed9acf4fd134f4faace1bda11702d" and "eca7e8df0dbef324bf889f0b10c657dcfec3d2cf" have entirely different histories.

View File

@ -202,7 +202,7 @@ const HIDE_NSFW_CLAUSE = '("Sub"."nsfw" = FALSE OR "Sub"."nsfw" IS NULL)'
export const nsfwClause = showNsfw => showNsfw ? '' : HIDE_NSFW_CLAUSE
const subClause = (sub, num, table = 'Item', me, showNsfw) => {
const subClause = (sub, num, table, me, showNsfw) => {
// Intentionally show nsfw posts (i.e. no nsfw clause) when viewing a specific nsfw sub
if (sub) {
const tables = [...new Set(['Item', table])].map(t => `"${t}".`)
@ -412,14 +412,10 @@ export default {
${whereClause(
'"Item"."deletedAt" IS NULL',
'"Item"."weightedVotes" - "Item"."weightedDownVotes" > 2',
'"Item"."ncomments" > 0',
'"Item"."parentId" IS NULL',
'"Item".bio = false',
type === 'posts' && '"Item"."subName" IS NOT NULL',
subClause(sub, 3, subClauseTable(type), me, showNsfw),
typeClause(type),
await filterClause(me, models, type),
activeOrMine(me),
muteClause(me))}
${orderByClause('random', me, models, type)}
OFFSET $1