Compare commits

...

4 Commits

Author SHA1 Message Date
Nathan Mattes c02eb14cec
Merge 409fade845 into ae02dd2994 2024-04-24 10:49:17 +02:00
Renaud Chaput ae02dd2994
Fix CI badge (#1264)
This PR fixes the CI badge in README. It seems that main.yml has been
renamed to build-only.yml.
2024-04-24 10:42:20 +02:00
Nathan Mattes 409fade845 Only set edit-stuff once (#1276) 2024-04-21 13:27:12 +02:00
woxtu 6c9ce0de88 Fix CI badge 2024-03-29 19:37:32 +09:00
3 changed files with 20 additions and 25 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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&amp;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&amp;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>