Use account on account-switcher (IOS-192)
This commit is contained in:
parent
6b6ed28134
commit
22d0b45be7
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue