From 46eeb729c3a5b984ba55ceb1711b2206207f699f Mon Sep 17 00:00:00 2001 From: ekzyis Date: Sun, 4 Feb 2024 22:15:18 +0100 Subject: [PATCH] Fix pinned items don't show up in home --- api/resolvers/item.js | 3 ++- components/items.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/resolvers/item.js b/api/resolvers/item.js index f0a145e7..dc6f6c37 100644 --- a/api/resolvers/item.js +++ b/api/resolvers/item.js @@ -465,7 +465,8 @@ export default { ${whereClause( subClause(sub, 3, 'Item', me), muteClause(me), - '"Item"."pinId" IS NULL', + // in "home" (sub undefined), we want to show pinned items (but without the pin icon) + sub ? '"Item"."pinId" IS NULL' : '', '"Item"."deletedAt" IS NULL', '"Item"."parentId" IS NULL', '"Item".bio = false', diff --git a/components/items.js b/components/items.js index d1d4e82c..1aeb604d 100644 --- a/components/items.js +++ b/components/items.js @@ -45,11 +45,13 @@ export default function Items ({ ssrData, variables = {}, query, destructureData return } + const isHome = !variables?.sub + return ( <>
{itemsWithPins.filter(filter).map((item, i) => ( - 0} /> + 0} /> ))}