Compare commits
4 Commits
2d360f35e1
...
c02eb14cec
Author | SHA1 | Date |
---|---|---|
Nathan Mattes | c02eb14cec | |
Renaud Chaput | ae02dd2994 | |
Nathan Mattes | 409fade845 | |
woxtu | 6c9ce0de88 |
|
@ -51,30 +51,24 @@ final class ProfileHeaderViewModel {
|
|||
self.account = account
|
||||
self.me = me
|
||||
self.relationship = relationship
|
||||
|
||||
$accountForEdit
|
||||
.receive(on: DispatchQueue.main)
|
||||
.sink { [weak self] account in
|
||||
guard let self = self else { return }
|
||||
guard let account = account else { return }
|
||||
// banner
|
||||
self.profileInfo.header = nil
|
||||
self.profileInfoEditing.header = nil
|
||||
// avatar
|
||||
self.profileInfo.avatar = nil
|
||||
self.profileInfoEditing.avatar = nil
|
||||
// name
|
||||
let name = account.displayNameWithFallback
|
||||
self.profileInfo.name = name
|
||||
self.profileInfoEditing.name = name
|
||||
// bio
|
||||
let note = ProfileHeaderViewModel.normalize(note: account.note)
|
||||
self.profileInfo.note = note
|
||||
self.profileInfoEditing.note = note
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
}
|
||||
|
||||
public func setProfileInfo(accountForEdit: Mastodon.Entity.Account) {
|
||||
// banner
|
||||
profileInfo.header = nil
|
||||
profileInfoEditing.header = nil
|
||||
// avatar
|
||||
profileInfo.avatar = nil
|
||||
profileInfoEditing.avatar = nil
|
||||
|
||||
let name = account.displayNameWithFallback
|
||||
profileInfo.name = name
|
||||
profileInfoEditing.name = name
|
||||
// bio
|
||||
let note = ProfileHeaderViewModel.normalize(note: account.note)
|
||||
profileInfo.note = note
|
||||
profileInfoEditing.note = note
|
||||
}
|
||||
}
|
||||
|
||||
extension ProfileHeaderViewModel {
|
||||
|
|
|
@ -794,8 +794,9 @@ extension ProfileViewController: ProfileHeaderViewControllerDelegate {
|
|||
profileAboutViewModel.isEditing = true
|
||||
}
|
||||
} receiveValue: { [weak self] response in
|
||||
guard let self = self else { return }
|
||||
self.viewModel.accountForEdit = response.value
|
||||
guard let self else { return }
|
||||
|
||||
self.profileHeaderViewController.viewModel.setProfileInfo(accountForEdit: response.value)
|
||||
}
|
||||
.store(in: &disposeBag)
|
||||
} else if isEdited == false {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Mastodon
|
||||
|
||||
[![CI](https://github.com/mastodon/mastodon-ios/actions/workflows/main.yml/badge.svg)](https://github.com/mastodon/mastodon-ios/actions/workflows/main.yml) [![Crowdin](https://badges.crowdin.net/mastodon-for-ios/localized.svg)](https://crowdin.com/project/mastodon-for-ios)
|
||||
[![CI](https://github.com/mastodon/mastodon-ios/actions/workflows/build-only.yml/badge.svg)](https://github.com/mastodon/mastodon-ios/actions/workflows/build-only.yml) [![Crowdin](https://badges.crowdin.net/mastodon-for-ios/localized.svg)](https://crowdin.com/project/mastodon-for-ios)
|
||||
|
||||
<a href="https://apps.apple.com/us/app/mastodon-for-iphone/id1571998974?itsct=apps_box_badge&itscg=30200" style="display: inline-block; overflow: hidden; border-top-left-radius: 13px; border-top-right-radius: 13px; border-bottom-right-radius: 13px; border-bottom-left-radius: 13px; width: 250px; height: 83px;"><img src="https://tools.applemediaservices.com/api/badges/download-on-the-app-store/black/en-us?size=250x83&releaseDate=1627603200&h=72b0c8495c2c0af1291efef280c4c2c1" alt="Download on the App Store" style="border-top-left-radius: 13px; border-top-right-radius: 13px; border-bottom-right-radius: 13px; border-bottom-left-radius: 13px; width: 250px; height: 83px;"></a>
|
||||
|
||||
|
|
Loading…
Reference in New Issue