Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Embeds] Show error for users with PWI flag on landing (#3524)

authored by

dan and committed by
GitHub
a845587e 4c966e5d

+11 -14
+11 -14
bskyembed/src/screens/landing.tsx
··· 86 86 if (!AppBskyFeedDefs.isThreadViewPost(data.thread)) { 87 87 throw new Error('Post not found') 88 88 } 89 - 89 + const pwiOptOut = !!data.thread.post.author.labels?.find( 90 + label => label.val === '!no-unauthenticated', 91 + ) 92 + if (pwiOptOut) { 93 + throw new Error( 94 + 'The author of this post has requested their posts not be displayed on external sites.', 95 + ) 96 + } 90 97 setThread(data.thread) 91 98 } catch (err) { 92 99 console.error(err) ··· 113 120 className="border rounded-lg py-3 w-full max-w-[600px] px-4" 114 121 placeholder={DEFAULT_POST} 115 122 /> 116 - <p className={`text-red-500 ${error ? '' : 'invisible'}`}>{error}</p> 117 123 </div> 118 124 119 125 <img src={arrowBottom as string} className="w-6" /> 120 126 121 127 <div className="w-full max-w-[600px] gap-8 flex flex-col"> 122 128 {uri && !error && thread && <Snippet thread={thread} />} 123 - 124 - {thread ? ( 125 - <Post thread={thread} key={thread.post.uri} /> 126 - ) : ( 127 - <Container href="https://bsky.social/about"> 128 - <Link 129 - href="https://bsky.social/about" 130 - className="transition-transform hover:scale-110 absolute top-4 right-4"> 131 - <img src={logo as string} className="h-8" /> 132 - </Link> 133 - <div className="h-32" /> 134 - </Container> 129 + {!error && thread && <Post thread={thread} key={thread.post.uri} />} 130 + {error && ( 131 + <p className={`text-red-500 ${error ? '' : 'invisible'}`}>{error}</p> 135 132 )} 136 133 </div> 137 134 </main>