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
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,

View File

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