Fix fields (IOS-192)

This commit is contained in:
Nathan Mattes 2023-12-08 15:26:46 +01:00
parent 34b962e3ca
commit 873f282ad1
2 changed files with 8 additions and 19 deletions

View File

@ -19,7 +19,7 @@ final class ProfileAboutViewModel {
// input // input
let context: AppContext let context: AppContext
@Published var account: Mastodon.Entity.Account? @Published var account: Mastodon.Entity.Account
@Published var isEditing = false @Published var isEditing = false
@Published var accountForEdit: Mastodon.Entity.Account? @Published var accountForEdit: Mastodon.Entity.Account?
@ -32,24 +32,13 @@ final class ProfileAboutViewModel {
@Published var emojiMeta: MastodonContent.Emojis = [:] @Published var emojiMeta: MastodonContent.Emojis = [:]
@Published var createdAt: Date = Date() @Published var createdAt: Date = Date()
init(context: AppContext) { init(context: AppContext, account: Mastodon.Entity.Account) {
self.account = account
self.context = context self.context = context
#warning("TODO: Implement")
// $account emojiMeta = account.emojiMeta
// .compactMap { $0 } fields = account.mastodonFields
// .flatMap { $0.publisher(for: \.emojis) } createdAt = account.createdAt
// .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)
Publishers.CombineLatest( Publishers.CombineLatest(
$fields, $fields,

View File

@ -78,7 +78,7 @@ class ProfileViewModel: NSObject {
title: L10n.Scene.Profile.SegmentedControl.media, title: L10n.Scene.Profile.SegmentedControl.media,
queryFilter: .init(onlyMedia: true) queryFilter: .init(onlyMedia: true)
) )
self.profileAboutViewModel = ProfileAboutViewModel(context: context) self.profileAboutViewModel = ProfileAboutViewModel(context: context, account: account)
super.init() super.init()
// bind me // bind me