Skip to content

Commit

Permalink
fix: account name overflows in top bar - WPB-7281 (#1642)
Browse files Browse the repository at this point in the history
  • Loading branch information
netbe authored Jul 3, 2024
1 parent 94d8c9d commit 9d1202e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ class TitleView: UIView, DynamicTypeCapable {
}

createViews()
createConstraints()
}

// MARK: - Private methods
private func createConstraints() {
[titleButton, stackView, subtitleLabel].forEach { $0.translatesAutoresizingMaskIntoConstraints = false }

stackView.fitIn(view: self)
}
Expand Down Expand Up @@ -93,7 +93,6 @@ class TitleView: UIView, DynamicTypeCapable {
subtitleLabel.text = subtitle
subtitleLabel.font = .smallLightFont

createConstraints()
}

required init?(coder aDecoder: NSCoder) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,18 @@ final class ConversationListTopBarViewController: UIViewController {

/// Name, availability and verification info about the self user.
public var selfUserStatus = UserStatus() {
didSet { updateTitleView() }
didSet {
guard viewIfLoaded != nil else { return }
updateTitleView()
}
}

private let selfUser: SelfUserType
private var userSession: UserSession
private var observerToken: NSObjectProtocol?

var topBar: TopBar? {
view as? TopBar
private var topBar: TopBar? {
viewIfLoaded as? TopBar
}

private weak var userStatusViewController: UserStatusViewController?
Expand Down Expand Up @@ -85,7 +88,7 @@ final class ConversationListTopBarViewController: UIViewController {

// MARK: - Title View

func updateTitleView() {
private func updateTitleView() {
if selfUser.isTeamMember {
defer { userStatusViewController?.userStatus = selfUserStatus }
guard userStatusViewController == nil else { return }
Expand Down Expand Up @@ -169,7 +172,7 @@ final class ConversationListTopBarViewController: UIViewController {
return button
}

func updateAccountView() {
private func updateAccountView() {
topBar?.leftView = createAccountView()
}

Expand Down

0 comments on commit 9d1202e

Please sign in to comment.