fix: [code-625]: fix url params on repo listing page

This commit is contained in:
calvin 2023-07-10 15:43:43 -06:00
parent f8092fe117
commit 17f96a5c3a
4 changed files with 12 additions and 4 deletions

View File

@ -59,7 +59,9 @@ export default function RepositoriesListing() {
useEffect(() => { useEffect(() => {
setSearchTerm(undefined) setSearchTerm(undefined)
if (page > 1) {
updateQueryParams({ page: page.toString() }) updateQueryParams({ page: page.toString() })
}
}, [space, setPage]) // eslint-disable-line react-hooks/exhaustive-deps }, [space, setPage]) // eslint-disable-line react-hooks/exhaustive-deps
const columns: Column<TypesRepository>[] = useMemo( const columns: Column<TypesRepository>[] = useMemo(

View File

@ -44,7 +44,9 @@ export function RepositoryBranchesContent({ repoMetadata }: Pick<GitInfoProps, '
}) })
useEffect(() => { useEffect(() => {
if (page > 1) {
updateQueryParams({ page: page.toString() }) updateQueryParams({ page: page.toString() })
}
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps }, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
useShowRequestError(error) useShowRequestError(error)

View File

@ -55,7 +55,9 @@ export function RepositoryTagsContent({ repoMetadata }: Pick<GitInfoProps, 'repo
}) })
useEffect(() => { useEffect(() => {
if (page > 1) {
updateQueryParams({ page: page.toString() }) updateQueryParams({ page: page.toString() })
}
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps }, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
useShowRequestError(error) useShowRequestError(error)

View File

@ -69,7 +69,9 @@ export default function Webhooks() {
lazy: !repoMetadata lazy: !repoMetadata
}) })
useEffect(() => { useEffect(() => {
if (page > 1) {
updateQueryParams({ page: page.toString() }) updateQueryParams({ page: page.toString() })
}
}, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps }, [setPage]) // eslint-disable-line react-hooks/exhaustive-deps
const columns: Column<OpenapiWebhookType>[] = useMemo( const columns: Column<OpenapiWebhookType>[] = useMemo(