+9
-1
lib/hooks/usePaginatedRecords.ts
+9
-1
lib/hooks/usePaginatedRecords.ts
···
68
69
const DEFAULT_APPVIEW_SERVICE = 'https://public.api.bsky.app';
70
71
export type AuthorFeedFilter =
72
| 'posts_with_replies'
73
| 'posts_no_replies'
···
178
nextCursor = feedCursor;
179
} catch (err) {
180
feedDisabledRef.current = true;
181
-
if (process.env.NODE_ENV !== 'production') {
182
console.warn('[usePaginatedRecords] Author feed unavailable, falling back to PDS', err);
183
}
184
}
···
68
69
const DEFAULT_APPVIEW_SERVICE = 'https://public.api.bsky.app';
70
71
+
type MaybeNodeEnv = { process?: { env?: Record<string, string | undefined> } };
72
+
73
+
const isNonProductionEnv = (): boolean => {
74
+
if (typeof globalThis === 'undefined') return false;
75
+
const env = (globalThis as MaybeNodeEnv).process?.env?.NODE_ENV;
76
+
return env ? env !== 'production' : false;
77
+
};
78
+
79
export type AuthorFeedFilter =
80
| 'posts_with_replies'
81
| 'posts_no_replies'
···
186
nextCursor = feedCursor;
187
} catch (err) {
188
feedDisabledRef.current = true;
189
+
if (isNonProductionEnv()) {
190
console.warn('[usePaginatedRecords] Author feed unavailable, falling back to PDS', err);
191
}
192
}