From 8f642ea021705b452778a985eec8b6affc4ce79f Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Sat, 25 May 2024 19:56:20 +0200 Subject: [PATCH] Also update avatar on iPad (IOS-277) --- Mastodon/Scene/Root/Sidebar/SidebarViewController.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Mastodon/Scene/Root/Sidebar/SidebarViewController.swift b/Mastodon/Scene/Root/Sidebar/SidebarViewController.swift index e13fa8443..fa6d75774 100644 --- a/Mastodon/Scene/Root/Sidebar/SidebarViewController.swift +++ b/Mastodon/Scene/Root/Sidebar/SidebarViewController.swift @@ -135,6 +135,14 @@ extension SidebarViewController { sidebarDoubleTapGestureRecognizer.cancelsTouchesInView = true collectionView.addGestureRecognizer(sidebarDoubleTapGestureRecognizer) + NotificationCenter.default.publisher(for: .userFetched) + .receive(on: DispatchQueue.main) + .sink { [weak self] _ in + guard let self, let snapshot = self.viewModel.diffableDataSource?.snapshot() else { return } + + self.viewModel.diffableDataSource?.applySnapshotUsingReloadData(snapshot) + } + .store(in: &disposeBag) } override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {