Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/apps/profiles/src/member-profile/MemberProfilePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Params, useParams } from 'react-router-dom'
import { profileContext, ProfileContextData, profileGetPublicAsync, UserProfile } from '~/libs/core'
import { LoadingSpinner } from '~/libs/ui'

import { notifyUniNavi } from '../lib'

import { ProfilePageLayout } from './page-layout'

const MemberProfilePage: FC<{}> = () => {
Expand All @@ -29,12 +31,15 @@ const MemberProfilePage: FC<{}> = () => {
}
}, [routeParams.memberHandle])

const refreshProfile: (handle: string) => void = useCallback((handle: string) => {
const refreshProfile = useCallback((handle: string) => (
profileGetPublicAsync(handle)
.then(userProfile => {
setProfile(userProfile)
if (userProfile) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good catch. Right place for calling udpate!

notifyUniNavi(userProfile)
}
})
}, [])
), [])

return (
<>
Expand Down
2 changes: 0 additions & 2 deletions src/apps/profiles/src/member-profile/about-me/AboutMe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { useMemberTraits, UserProfile, UserTraitIds, UserTraits } from '~/libs/c

import { EditMemberPropertyBtn, EmptySection } from '../../components'
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
import { notifyUniNavi } from '../../lib'

import { ModifyAboutMeModal } from './ModifyAboutMeModal'
import styles from './AboutMe.module.scss'
Expand Down Expand Up @@ -60,7 +59,6 @@ const AboutMe: FC<AboutMeProps> = (props: AboutMeProps) => {
setIsEditMode(false)
mutateTraits()
props.refreshProfile(props.profile.handle)
notifyUniNavi(props.profile)
}, 1000)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { useMemberTraits, UserProfile, UserTrait, UserTraitIds, UserTraits } fro
import { EditMemberPropertyBtn } from '../../../components'
import { OpenForGigsModifyModal } from '../OpenForGigsModifyModal'
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../../config'
import { notifyUniNavi } from '../../../lib'

import styles from './OpenForGigs.module.scss'

Expand Down Expand Up @@ -53,6 +54,7 @@ const OpenForGigs: FC<OpenForGigsProps> = (props: OpenForGigsProps) => {
setTimeout(() => {
setIsEditMode(false)
mutateTraits()
notifyUniNavi(props.profile)
}, 1000)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import { Button, IconOutline } from '~/libs/ui'

import { EditMemberPropertyBtn } from '../../components'
import { EDIT_MODE_QUERY_PARAM, profileEditModes } from '../../config'
import { notifyUniNavi } from '../../lib'

import { OpenForGigs } from './OpenForGigs'
import { ModifyMemberNameModal } from './ModifyMemberNameModal'
Expand Down Expand Up @@ -93,7 +92,6 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => {
setTimeout(() => {
setIsNameEditMode(false)
props.refreshProfile(props.profile.handle)
notifyUniNavi(props.profile)
}, 1000)
}

Expand All @@ -109,7 +107,6 @@ const ProfileHeader: FC<ProfileHeaderProps> = (props: ProfileHeaderProps) => {
setTimeout(() => {
setIsPhotoEditMode(false)
props.refreshProfile(props.profile.handle)
notifyUniNavi(props.profile)
}, 1000)
}

Expand Down