AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
fix(frontend): prevent crash on /library with 401 error from pagination helper (#12292)
Bently5d56548e6b3b
diff --git a/autogpt_platform/frontend/src/app/api/helpers.ts b/autogpt_platform/frontend/src/app/api/helpers.tsindex 226f5fa786..4c37f125ad 100644--- a/autogpt_platform/frontend/src/app/api/helpers.ts+++ b/autogpt_platform/frontend/src/app/api/helpers.ts@@ -53,6 +53,8 @@ export function getPaginationNextPageNumber(if (!hasValidPaginationInfo(lastPage)) return undefined;const { pagination } = lastPage.data;+ if (!pagination) return undefined;+const hasMore =pagination.current_page * pagination.page_size < pagination.total_items;return hasMore ? pagination.current_page + 1 : undefined;