From 1cd7bc9105f1658843f35b2ac77a06e15b60f015 Mon Sep 17 00:00:00 2001 From: Nathan Mattes Date: Mon, 22 May 2023 13:28:18 +0200 Subject: [PATCH] Make follow work (IOS-157) The secret is to set the delegate before getting the account. This doesn't feel right. --- Mastodon/Scene/SuggestionAccount/RecommendAccountSection.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Mastodon/Scene/SuggestionAccount/RecommendAccountSection.swift b/Mastodon/Scene/SuggestionAccount/RecommendAccountSection.swift index 8a913609d..15d259d0e 100644 --- a/Mastodon/Scene/SuggestionAccount/RecommendAccountSection.swift +++ b/Mastodon/Scene/SuggestionAccount/RecommendAccountSection.swift @@ -35,12 +35,13 @@ extension RecommendAccountSection { let cell = tableView.dequeueReusableCell(withIdentifier: String(describing: SuggestionAccountTableViewCell.self)) as! SuggestionAccountTableViewCell switch item { case .account(let record): + cell.delegate = configuration.suggestionAccountTableViewCellDelegate context.managedObjectContext.performAndWait { guard let user = record.object(in: context.managedObjectContext) else { return } cell.configure(user: user) } - cell.delegate = configuration.suggestionAccountTableViewCellDelegate + } return cell }