diff --git a/src/state/models/shell-ui.ts b/src/state/models/shell-ui.ts index 8eefc711..cc884f1c 100644 --- a/src/state/models/shell-ui.ts +++ b/src/state/models/shell-ui.ts @@ -42,7 +42,10 @@ export class SharePostModel { export class EditProfileModel { name = 'edit-profile' - constructor(public profileView: ProfileViewModel) { + constructor( + public profileView: ProfileViewModel, + public onUpdate?: () => void, + ) { makeAutoObservable(this) } } diff --git a/src/view/com/modals/EditProfile.tsx b/src/view/com/modals/EditProfile.tsx index 2bc02afe..7310ab59 100644 --- a/src/view/com/modals/EditProfile.tsx +++ b/src/view/com/modals/EditProfile.tsx @@ -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('') const [displayName, setDisplayName] = useState( @@ -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) diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index b7440d31..73ddddde 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -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`) diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index ca058722..7d72715b 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -123,7 +123,7 @@ export const Profile = observer(({visible, params}: ScreenParams) => { ) { if (uiState.feed.hasContent) { items = uiState.feed.feed.slice() - if (uiState.feed.hasReachedEnd) { + if (!uiState.feed.hasMore) { items.push(END_ITEM) } renderItem = (item: any) => {