Use account on account-switcher (IOS-192)

This commit is contained in:
Nathan Mattes 2024-01-05 12:56:08 +01:00
parent 6b6ed28134
commit 22d0b45be7
1 changed files with 6 additions and 6 deletions

View File

@ -103,25 +103,25 @@ extension AccountListViewModel {
authentication: MastodonAuthentication, authentication: MastodonAuthentication,
activeAuthentication: MastodonAuthentication activeAuthentication: MastodonAuthentication
) { ) {
guard let user = authentication.user(in: context) else { return } guard let account = authentication.account() else { return }
// avatar // avatar
cell.avatarButton.avatarImageView.configure( cell.avatarButton.avatarImageView.configure(
configuration: .init(url: user.avatarImageURL()) configuration: .init(url: account.avatarImageURL())
) )
// name // name
do { do {
let content = MastodonContent(content: user.displayNameWithFallback, emojis: user.emojis.asDictionary) let content = MastodonContent(content: account.displayNameWithFallback, emojis: account.emojis.asDictionary)
let metaContent = try MastodonMetaContent.convert(document: content) let metaContent = try MastodonMetaContent.convert(document: content)
cell.nameLabel.configure(content: metaContent) cell.nameLabel.configure(content: metaContent)
} catch { } catch {
assertionFailure() assertionFailure()
cell.nameLabel.configure(content: PlaintextMetaContent(string: user.displayNameWithFallback)) cell.nameLabel.configure(content: PlaintextMetaContent(string: account.displayNameWithFallback))
} }
// username // username
let usernameMetaContent = PlaintextMetaContent(string: "@" + user.acctWithDomain) let usernameMetaContent = PlaintextMetaContent(string: "@" + account.acctWithDomain)
cell.usernameLabel.configure(content: usernameMetaContent) cell.usernameLabel.configure(content: usernameMetaContent)
// badge // badge