Update all state on profile change

This commit is contained in:
Paul Frazee 2022-11-14 15:55:38 -06:00
parent 96dc748733
commit 9170040acb
4 changed files with 14 additions and 4 deletions

View file

@ -11,7 +11,13 @@ import * as Profile from '../../../third-party/api/src/client/types/app/bsky/act
export const snapPoints = ['80%']
export function Component({profileView}: {profileView: ProfileViewModel}) {
export function Component({
profileView,
onUpdate,
}: {
profileView: ProfileViewModel
onUpdate?: () => void
}) {
const store = useStores()
const [error, setError] = useState<string>('')
const [displayName, setDisplayName] = useState<string>(
@ -41,6 +47,7 @@ export function Component({profileView}: {profileView: ProfileViewModel}) {
Toast.show('Profile updated', {
position: Toast.positions.TOP,
})
onUpdate?.()
store.shell.closeModal()
} catch (e: any) {
console.error(e)

View file

@ -59,7 +59,7 @@ export const ProfileHeader = observer(function ProfileHeader({
)
}
const onPressEditProfile = () => {
store.shell.openModal(new EditProfileModel(view))
store.shell.openModal(new EditProfileModel(view, onRefreshAll))
}
const onPressFollowers = () => {
store.nav.navigate(`/profile/${view.handle}/followers`)