Merge pull request #235 from jedmund/fix-234

Navigating between profiles properly updates team data
This commit is contained in:
Justin Edmund 2023-02-05 13:23:27 -08:00 committed by GitHub
commit 7920f4278d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,6 +21,7 @@ import ErrorSection from '~components/ErrorSection'
import FilterBar from '~components/FilterBar'
import ProfileHead from '~components/ProfileHead'
import type { AxiosError } from 'axios'
import type { NextApiRequest, NextApiResponse } from 'next'
import type {
FilterObject,
@ -28,7 +29,6 @@ import type {
PaginationObject,
ResponseStatus,
} from '~types'
import { AxiosError } from 'axios'
interface Props {
context?: PageContextObj
@ -160,7 +160,7 @@ const ProfileRoute: React.FC<Props> = ({
.catch((error) => handleError(error))
}
},
[currentPage, parties, element, raid, recency]
[currentPage, username, parties, element, raid, recency]
)
function replaceResults(count: number, list: Party[]) {
@ -194,7 +194,7 @@ const ProfileRoute: React.FC<Props> = ({
useDidMountEffect(() => {
setCurrentPage(1)
fetchProfile({ replace: true })
}, [element, raid, recency])
}, [username, element, raid, recency])
// When the page changes, fetch all teams again.
useDidMountEffect(() => {