mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
0
fork

Configure Feed

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

Better handle feed auth failures (#2060)

* Better handle feed auth failures

* Add comment

authored by

Eric Bailey and committed by
GitHub
f80bd30e edc9ac27

+7 -6
+7 -6
src/state/queries/feed.ts
··· 177 177 }) 178 178 return Boolean(res.data.feed) 179 179 } catch (e: any) { 180 - const msg = e.toString() as string 181 - 182 - if (msg.includes('missing jwt')) { 183 - return false 184 - } else if (msg.includes('This feed requires being logged-in')) { 185 - // e.g. https://github.com/bluesky-social/atproto/blob/99ab1ae55c463e8d5321a1eaad07a175bdd56fea/packages/bsky/src/feed-gen/best-of-follows.ts#L13 180 + /** 181 + * This should be an `XRPCError`, but I can't safely import from 182 + * `@atproto/xrpc` due to a depdency on node's `crypto` module. 183 + * 184 + * @see https://github.com/bluesky-social/atproto/blob/c17971a2d8e424cc7f10c071d97c07c08aa319cf/packages/xrpc/src/client.ts#L126 185 + */ 186 + if (e?.status === 401) { 186 187 return false 187 188 } 188 189