A React component library for rendering common AT Protocol records for applications such as Bluesky and Leaflet.

better productionenv checking

Changed files
+9 -1
lib
+9 -1
lib/hooks/usePaginatedRecords.ts
···
const DEFAULT_APPVIEW_SERVICE = 'https://public.api.bsky.app';
+
type MaybeNodeEnv = { process?: { env?: Record<string, string | undefined> } };
+
+
const isNonProductionEnv = (): boolean => {
+
if (typeof globalThis === 'undefined') return false;
+
const env = (globalThis as MaybeNodeEnv).process?.env?.NODE_ENV;
+
return env ? env !== 'production' : false;
+
};
+
export type AuthorFeedFilter =
| 'posts_with_replies'
| 'posts_no_replies'
···
nextCursor = feedCursor;
} catch (err) {
feedDisabledRef.current = true;
-
if (process.env.NODE_ENV !== 'production') {
+
if (isNonProductionEnv()) {
console.warn('[usePaginatedRecords] Author feed unavailable, falling back to PDS', err);
}
}