Skip to content

Commit a92215c

Browse files
Soxasorahuumn
andauthored
fix: globally pinned items rank in global (#1814)
* fix: globally pinned items rank in global; use query to filter global pinned items * cleanup --------- Co-authored-by: Keyan <[email protected]>
1 parent 382714e commit a92215c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/resolvers/item.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -536,8 +536,8 @@ export default {
536536
LEFT JOIN "Sub" ON "Sub"."name" = "Item"."subName"
537537
${joinZapRankPersonalView(me, models)}
538538
${whereClause(
539-
// in "home" (sub undefined), we want to show pinned items (but without the pin icon)
540-
sub ? '"Item"."pinId" IS NULL' : '',
539+
// in home (sub undefined), filter out global pinned items since we inject them later
540+
sub ? '"Item"."pinId" IS NULL' : 'NOT ("Item"."pinId" IS NOT NULL AND "Item"."subName" IS NULL)',
541541
'"Item"."deletedAt" IS NULL',
542542
'"Item"."parentId" IS NULL',
543543
'"Item".outlawed = false',
@@ -565,8 +565,8 @@ export default {
565565
${whereClause(
566566
subClause(sub, 3, 'Item', me, showNsfw),
567567
muteClause(me),
568-
// in "home" (sub undefined), we want to show pinned items (but without the pin icon)
569-
sub ? '"Item"."pinId" IS NULL' : '',
568+
// in home (sub undefined), filter out global pinned items since we inject them later
569+
sub ? '"Item"."pinId" IS NULL' : 'NOT ("Item"."pinId" IS NOT NULL AND "Item"."subName" IS NULL)',
570570
'"Item"."deletedAt" IS NULL',
571571
'"Item"."parentId" IS NULL',
572572
'"Item".bio = false',

0 commit comments

Comments
 (0)