diff --git a/autogpt_platform/frontend/src/app/(platform)/library/components/useLibraryListPage.ts b/autogpt_platform/frontend/src/app/(platform)/library/components/useLibraryListPage.ts index dbacdeeae6..beaa5040dc 100644 --- a/autogpt_platform/frontend/src/app/(platform)/library/components/useLibraryListPage.ts +++ b/autogpt_platform/frontend/src/app/(platform)/library/components/useLibraryListPage.ts @@ -2,7 +2,7 @@ import { LibraryAgentSort } from "@/app/api/__generated__/models/libraryAgentSort"; import { parseAsStringEnum, useQueryState } from "nuqs"; -import { useCallback, useEffect, useMemo, useState } from "react"; +import { useCallback, useMemo, useState } from "react"; const sortParser = parseAsStringEnum(Object.values(LibraryAgentSort)); @@ -11,13 +11,6 @@ export function useLibraryListPage() { const [uploadedFile, setUploadedFile] = useState(null); const [librarySortRaw, setLibrarySortRaw] = useQueryState("sort", sortParser); - // Ensure sort param is always present in URL (even if default) - useEffect(() => { - if (!librarySortRaw) { - setLibrarySortRaw(LibraryAgentSort.lastExecuted, { shallow: false }); - } - }, [librarySortRaw, setLibrarySortRaw]); - const librarySort = librarySortRaw || LibraryAgentSort.lastExecuted; const setLibrarySort = useCallback( diff --git a/autogpt_platform/frontend/src/tests/signin.spec.ts b/autogpt_platform/frontend/src/tests/signin.spec.ts index 35e5c71167..865d670c22 100644 --- a/autogpt_platform/frontend/src/tests/signin.spec.ts +++ b/autogpt_platform/frontend/src/tests/signin.spec.ts @@ -182,7 +182,7 @@ test("logged in user is redirected from /login to /library", async ({ await hasUrl(page, "/marketplace"); await page.goto("/login"); - await hasUrl(page, "/library?sort=lastExecuted"); + await hasUrl(page, "/library"); }); test("logged in user is redirected from /signup to /library", async ({ @@ -195,5 +195,5 @@ test("logged in user is redirected from /signup to /library", async ({ await hasUrl(page, "/marketplace"); await page.goto("/signup"); - await hasUrl(page, "/library?sort=lastExecuted"); + await hasUrl(page, "/library"); });