Merge pull request #785 from stackernews/773-fix-pins-prevent-post-show-up-in-feeds
Fix pinned items don't show up in home
This commit is contained in:
		
						commit
						65cc1dbcc0
					
				@ -465,7 +465,8 @@ export default {
 | 
				
			|||||||
                      ${whereClause(
 | 
					                      ${whereClause(
 | 
				
			||||||
                        subClause(sub, 3, 'Item', me),
 | 
					                        subClause(sub, 3, 'Item', me),
 | 
				
			||||||
                        muteClause(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"."deletedAt" IS NULL',
 | 
				
			||||||
                        '"Item"."parentId" IS NULL',
 | 
					                        '"Item"."parentId" IS NULL',
 | 
				
			||||||
                        '"Item".bio = false',
 | 
					                        '"Item".bio = false',
 | 
				
			||||||
 | 
				
			|||||||
@ -45,11 +45,13 @@ export default function Items ({ ssrData, variables = {}, query, destructureData
 | 
				
			|||||||
    return <Skeleton />
 | 
					    return <Skeleton />
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  const isHome = !variables?.sub
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
    <>
 | 
					    <>
 | 
				
			||||||
      <div className={styles.grid}>
 | 
					      <div className={styles.grid}>
 | 
				
			||||||
        {itemsWithPins.filter(filter).map((item, i) => (
 | 
					        {itemsWithPins.filter(filter).map((item, i) => (
 | 
				
			||||||
          <ListItem key={item.id} item={item} rank={rank && i + 1} siblingComments={variables.includeComments} pinnable={pins?.length > 0} />
 | 
					          <ListItem key={item.id} item={item} rank={rank && i + 1} siblingComments={variables.includeComments} pinnable={isHome ? false : pins?.length > 0} />
 | 
				
			||||||
        ))}
 | 
					        ))}
 | 
				
			||||||
      </div>
 | 
					      </div>
 | 
				
			||||||
      <Foooter
 | 
					      <Foooter
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user