about summary refs log tree commit diff
path: root/src/state/queries/feed.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/state/queries/feed.ts')
-rw-r--r--src/state/queries/feed.ts45
1 files changed, 0 insertions, 45 deletions
diff --git a/src/state/queries/feed.ts b/src/state/queries/feed.ts
index e431643e7..c9d81bc17 100644
--- a/src/state/queries/feed.ts
+++ b/src/state/queries/feed.ts
@@ -161,51 +161,6 @@ export function useFeedSourceInfoQuery({uri}: {uri: string}) {
   })
 }
 
-export const isFeedPublicQueryKey = ({uri}: {uri: string}) => [
-  'isFeedPublic',
-  uri,
-]
-
-export function useIsFeedPublicQuery({uri}: {uri: string}) {
-  return useQuery({
-    queryKey: isFeedPublicQueryKey({uri}),
-    queryFn: async ({queryKey}) => {
-      const [, uri] = queryKey
-      try {
-        const res = await getAgent().app.bsky.feed.getFeed({
-          feed: uri,
-          limit: 1,
-        })
-        return {
-          isPublic: Boolean(res.data.feed),
-          error: undefined,
-        }
-      } catch (e: any) {
-        /**
-         * This should be an `XRPCError`, but I can't safely import from
-         * `@atproto/xrpc` due to a depdency on node's `crypto` module.
-         *
-         * @see https://github.com/bluesky-social/atproto/blob/c17971a2d8e424cc7f10c071d97c07c08aa319cf/packages/xrpc/src/client.ts#L126
-         */
-        if (e?.status === 401) {
-          return {
-            isPublic: false,
-            error: e,
-          }
-        }
-
-        /*
-         * Non-401 response means something else went wrong on the server
-         */
-        return {
-          isPublic: true,
-          error: e,
-        }
-      }
-    },
-  })
-}
-
 export const useGetPopularFeedsQueryKey = ['getPopularFeeds']
 
 export function useGetPopularFeedsQuery() {