Fix compose reply view missing MastodonController instance

This commit is contained in:
Shadowfacts 2020-01-20 15:25:23 -05:00
parent 12b6623113
commit 08086f1b18
Signed by untrusted user: shadowfacts
GPG Key ID: 94A5AB95422746E5
3 changed files with 7 additions and 2 deletions

View File

@ -193,6 +193,7 @@ class ComposeViewController: UIViewController {
}
let replyView = ComposeStatusReplyView.create()
replyView.mastodonController = mastodonController
replyView.updateUI(for: inReplyTo)
stackView.insertArrangedSubview(replyView, at: 0)

View File

@ -11,6 +11,8 @@ import Pachyderm
class ComposeStatusReplyView: UIView {
weak var mastodonController: MastodonController?
@IBOutlet weak var avatarImageView: UIImageView!
@IBOutlet weak var displayNameLabel: UILabel!
@IBOutlet weak var usernameLabel: UILabel!
@ -34,6 +36,7 @@ class ComposeStatusReplyView: UIView {
func updateUI(for status: Status) {
displayNameLabel.text = status.account.realDisplayName
usernameLabel.text = "@\(status.account.acct)"
statusContentTextView.overrideMastodonController = mastodonController
statusContentTextView.statusID = status.id
ImageCache.avatars.get(status.account.avatar) { (data) in

View File

@ -16,7 +16,8 @@ private let emojiRegex = try! NSRegularExpression(pattern: ":(\\w+):", options:
class ContentTextView: LinkTextView {
weak var navigationDelegate: TuskerNavigationDelegate?
var mastodonController: MastodonController? { navigationDelegate?.apiController }
weak var overrideMastodonController: MastodonController?
var mastodonController: MastodonController? { overrideMastodonController ?? navigationDelegate?.apiController }
var defaultFont: UIFont = .systemFont(ofSize: 17)
var defaultColor: UIColor = .label