don't filter freebies/outlaws on profiles + fix ~sub/recent/all
This commit is contained in:
parent
3608d133d7
commit
df7baf4d7c
|
@ -202,7 +202,10 @@ export const nsfwClause = showNsfw => showNsfw ? '' : HIDE_NSFW_CLAUSE
|
|||
|
||||
const subClause = (sub, num, table, me, showNsfw) => {
|
||||
// Intentionally show nsfw posts (i.e. no nsfw clause) when viewing a specific nsfw sub
|
||||
if (sub) { return `${table ? `"${table}".` : ''}"subName" = $${num}::CITEXT` }
|
||||
if (sub) {
|
||||
const tables = [...new Set(['Item', table])].map(t => `"${t}".`)
|
||||
return `(${tables.map(t => `${t}"subName" = $${num}::CITEXT`).join(' OR ')})`
|
||||
}
|
||||
|
||||
if (!me) { return HIDE_NSFW_CLAUSE }
|
||||
|
||||
|
@ -346,7 +349,6 @@ export default {
|
|||
${whereClause(
|
||||
`"${table}"."userId" = $3`,
|
||||
activeOrMine(me),
|
||||
await filterClause(me, models, type),
|
||||
nsfwClause(showNsfw),
|
||||
typeClause(type),
|
||||
whenClause(when || 'forever', table))}
|
||||
|
|
Loading…
Reference in New Issue