1
0
mirror of https://github.com/mastodon/mastodon-ios.git synced 2024-12-15 02:14:50 +01:00
mastodon-app-ufficiale-ipho.../MastodonSDK/Sources/MastodonUI/View/Content/FamiliarFollowersDashboardView+Configuration.swift

29 lines
790 B
Swift

//
// FamiliarFollowersDashboardView+Configuration.swift
//
//
// Created by MainasuK on 2022-5-16.
//
import UIKit
import MastodonSDK
import MastodonCore
extension FamiliarFollowersDashboardView {
public func configure(familiarFollowers: Mastodon.Entity.FamiliarFollowers?) {
assert(Thread.isMainThread)
let accounts = familiarFollowers?.accounts ?? []
viewModel.avatarURLs = accounts.map { $0.avatarImageURL() }
viewModel.names = accounts.map { $0.displayNameWithFallback }
viewModel.emojis = {
var array: [Mastodon.Entity.Emoji] = []
for account in accounts {
array.append(contentsOf: account.emojis ?? [])
}
return array.asDictionary
}()
}
}