Fix #234
This makes sure we fetch profiles when the username changes in the router, and also update the fetchProfile callback as well
This commit is contained in:
parent
0f75acbfd9
commit
12bc8f1f0f
1 changed files with 3 additions and 3 deletions
|
|
@ -21,6 +21,7 @@ import ErrorSection from '~components/ErrorSection'
|
||||||
import FilterBar from '~components/FilterBar'
|
import FilterBar from '~components/FilterBar'
|
||||||
import ProfileHead from '~components/ProfileHead'
|
import ProfileHead from '~components/ProfileHead'
|
||||||
|
|
||||||
|
import type { AxiosError } from 'axios'
|
||||||
import type { NextApiRequest, NextApiResponse } from 'next'
|
import type { NextApiRequest, NextApiResponse } from 'next'
|
||||||
import type {
|
import type {
|
||||||
FilterObject,
|
FilterObject,
|
||||||
|
|
@ -28,7 +29,6 @@ import type {
|
||||||
PaginationObject,
|
PaginationObject,
|
||||||
ResponseStatus,
|
ResponseStatus,
|
||||||
} from '~types'
|
} from '~types'
|
||||||
import { AxiosError } from 'axios'
|
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
context?: PageContextObj
|
context?: PageContextObj
|
||||||
|
|
@ -160,7 +160,7 @@ const ProfileRoute: React.FC<Props> = ({
|
||||||
.catch((error) => handleError(error))
|
.catch((error) => handleError(error))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[currentPage, parties, element, raid, recency]
|
[currentPage, username, parties, element, raid, recency]
|
||||||
)
|
)
|
||||||
|
|
||||||
function replaceResults(count: number, list: Party[]) {
|
function replaceResults(count: number, list: Party[]) {
|
||||||
|
|
@ -194,7 +194,7 @@ const ProfileRoute: React.FC<Props> = ({
|
||||||
useDidMountEffect(() => {
|
useDidMountEffect(() => {
|
||||||
setCurrentPage(1)
|
setCurrentPage(1)
|
||||||
fetchProfile({ replace: true })
|
fetchProfile({ replace: true })
|
||||||
}, [element, raid, recency])
|
}, [username, element, raid, recency])
|
||||||
|
|
||||||
// When the page changes, fetch all teams again.
|
// When the page changes, fetch all teams again.
|
||||||
useDidMountEffect(() => {
|
useDidMountEffect(() => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue