From 51591c95242b2bc88a202e2d9d103fbe1482c9d6 Mon Sep 17 00:00:00 2001 From: shannon Date: Wed, 11 Dec 2024 16:12:34 -0500 Subject: [PATCH] Refetch account info when returning to profile screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is almost certainly a duplication of effort when navigating to the profile screen initially, for now, but it means the account details are up to date after you’ve followed/unfollowed, etc, from pages in the same navigation stack. Fixes IOS-344 --- Mastodon/Scene/Profile/ProfileViewController.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Mastodon/Scene/Profile/ProfileViewController.swift b/Mastodon/Scene/Profile/ProfileViewController.swift index 8f4c7cb2ea..5ea47db64c 100644 --- a/Mastodon/Scene/Profile/ProfileViewController.swift +++ b/Mastodon/Scene/Profile/ProfileViewController.swift @@ -163,6 +163,12 @@ class ProfileViewController: UIViewController, MediaPreviewableViewController, A }.store(in: &subscriptions) } + override func viewWillAppear(_ animated: Bool) { + Task { + await self.refetchAllData() + } + } + private func updateDisplay(_ viewModel: ProfileViewModelImmutable) { guard isViewLoaded else { return } // TODO: careful about resetting things if we failed to push edits