Compare commits
3 Commits
eca7e8df0d
...
555601c7de
Author | SHA1 | Date | |
---|---|---|---|
|
555601c7de | ||
|
85e91ede47 | ||
|
accf5212b2 |
@ -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, me, showNsfw) => {
|
||||
const subClause = (sub, num, table = 'Item', 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,10 +412,14 @@ 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user