2022-05-16 13:42:03 +02:00
|
|
|
//
|
|
|
|
// FamiliarFollowersDashboardView+Configuration.swift
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Created by MainasuK on 2022-5-16.
|
|
|
|
//
|
|
|
|
|
|
|
|
import UIKit
|
|
|
|
import MastodonSDK
|
2022-09-30 13:28:09 +02:00
|
|
|
import MastodonCore
|
2022-05-16 13:42:03 +02:00
|
|
|
|
|
|
|
extension FamiliarFollowersDashboardView {
|
|
|
|
public func configure(familiarFollowers: Mastodon.Entity.FamiliarFollowers?) {
|
|
|
|
assert(Thread.isMainThread)
|
|
|
|
|
2022-05-17 17:27:58 +02:00
|
|
|
let accounts = familiarFollowers?.accounts ?? []
|
2022-05-16 13:42:03 +02:00
|
|
|
|
|
|
|
viewModel.avatarURLs = accounts.map { $0.avatarImageURL() }
|
|
|
|
viewModel.names = accounts.map { $0.displayNameWithFallback }
|
2022-05-17 11:40:19 +02:00
|
|
|
viewModel.emojis = {
|
|
|
|
var array: [Mastodon.Entity.Emoji] = []
|
|
|
|
for account in accounts {
|
|
|
|
array.append(contentsOf: account.emojis ?? [])
|
|
|
|
}
|
|
|
|
return array.asDictionary
|
|
|
|
}()
|
2022-05-16 13:42:03 +02:00
|
|
|
}
|
|
|
|
}
|