"About profile"-Fixes (#1290) (#1313)

When fixing the broken avatar-upload, we (well, I) broke the fields in
the "About"-section. This PR fixes two things:

1. It fixes #1290 (Now you can edit fields again)
2. Field weren't updated when using Pull to Refresh on the
Profile-screen.
This commit is contained in:
Nathan Mattes 2024-06-14 08:40:03 +02:00 committed by GitHub
commit c3db917025
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -607,6 +607,7 @@ extension ProfileViewController {
{
viewModel.account = updatedAccount
viewModel.relationship = updatedRelationship
viewModel.profileAboutViewModel.fields = updatedAccount.mastodonFields
}
if let updatedMe = try? await context.apiService.authenticatedUserInfo(authenticationBox: authContext.mastodonAuthenticationBox).value {
@ -761,6 +762,7 @@ extension ProfileViewController: ProfileHeaderViewControllerDelegate {
self.profileHeaderViewController.viewModel.isEditing = false
profileAboutViewModel.isEditing = false
self.viewModel.account = updatedAccount
self.viewModel.profileAboutViewModel.fields = updatedAccount.mastodonFields
} catch {
let alertController = UIAlertController(
@ -809,6 +811,7 @@ extension ProfileViewController: ProfileHeaderViewControllerDelegate {
guard let self else { return }
self.profileHeaderViewController.viewModel.setProfileInfo(accountForEdit: response.value)
self.viewModel.accountForEdit = response.value
}
.store(in: &disposeBag)
} else if isEdited == false {