Fix fields (IOS-192)
This commit is contained in:
parent
34b962e3ca
commit
873f282ad1
|
@ -19,7 +19,7 @@ final class ProfileAboutViewModel {
|
|||
|
||||
// input
|
||||
let context: AppContext
|
||||
@Published var account: Mastodon.Entity.Account?
|
||||
@Published var account: Mastodon.Entity.Account
|
||||
@Published var isEditing = false
|
||||
@Published var accountForEdit: Mastodon.Entity.Account?
|
||||
|
||||
|
@ -32,24 +32,13 @@ final class ProfileAboutViewModel {
|
|||
@Published var emojiMeta: MastodonContent.Emojis = [:]
|
||||
@Published var createdAt: Date = Date()
|
||||
|
||||
init(context: AppContext) {
|
||||
init(context: AppContext, account: Mastodon.Entity.Account) {
|
||||
self.account = account
|
||||
self.context = context
|
||||
#warning("TODO: Implement")
|
||||
// $account
|
||||
// .compactMap { $0 }
|
||||
// .flatMap { $0.publisher(for: \.emojis) }
|
||||
// .map { $0.asDictionary }
|
||||
// .assign(to: &$emojiMeta)
|
||||
//
|
||||
// $account
|
||||
// .compactMap { $0 }
|
||||
// .flatMap { $0.publisher(for: \.fields) }
|
||||
// .assign(to: &$fields)
|
||||
//
|
||||
// $account
|
||||
// .compactMap { $0 }
|
||||
// .flatMap { $0.publisher(for: \.createdAt) }
|
||||
// .assign(to: &$createdAt)
|
||||
|
||||
emojiMeta = account.emojiMeta
|
||||
fields = account.mastodonFields
|
||||
createdAt = account.createdAt
|
||||
|
||||
Publishers.CombineLatest(
|
||||
$fields,
|
||||
|
|
|
@ -78,7 +78,7 @@ class ProfileViewModel: NSObject {
|
|||
title: L10n.Scene.Profile.SegmentedControl.media,
|
||||
queryFilter: .init(onlyMedia: true)
|
||||
)
|
||||
self.profileAboutViewModel = ProfileAboutViewModel(context: context)
|
||||
self.profileAboutViewModel = ProfileAboutViewModel(context: context, account: account)
|
||||
super.init()
|
||||
|
||||
// bind me
|
||||
|
|
Loading…
Reference in New Issue