From 093334987741ad33a2442118bdd4a5726ad2405f Mon Sep 17 00:00:00 2001 From: Nicolas Mauri Date: Wed, 7 Jun 2023 16:53:34 +0200 Subject: [PATCH] Fix: Prevents UserAvatarView from disappearing due to incorrect width. --- Riot/Modules/Home/AllChats/AllChatsCoordinator.swift | 6 +++++- changelog.d/pr-7587.bugfix | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelog.d/pr-7587.bugfix diff --git a/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift b/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift index 8765adb05..5f5d5c12f 100644 --- a/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift +++ b/Riot/Modules/Home/AllChats/AllChatsCoordinator.swift @@ -379,8 +379,12 @@ class AllChatsCoordinator: NSObject, SplitViewMasterCoordinatorProtocol { let avatarView = UserAvatarView(frame: view.bounds.inset(by: avatarInsets)) avatarView.isUserInteractionEnabled = false avatarView.update(theme: ThemeService.shared().theme) - avatarView.autoresizingMask = [.flexibleHeight, .flexibleWidth] + avatarView.autoresizingMask = [.flexibleTopMargin, .flexibleBottomMargin] view.addSubview(avatarView) + NSLayoutConstraint.activate([ + view.widthAnchor.constraint(equalToConstant: 36), + view.heightAnchor.constraint(equalToConstant: 36) + ]) self.avatarMenuView = avatarView updateAvatarButtonItem() viewController.navigationItem.leftBarButtonItem = UIBarButtonItem(customView: view) diff --git a/changelog.d/pr-7587.bugfix b/changelog.d/pr-7587.bugfix new file mode 100644 index 000000000..1ddb185a9 --- /dev/null +++ b/changelog.d/pr-7587.bugfix @@ -0,0 +1 @@ +Prevents user avatar from disappearing due to incorrect width.