From 947f27f2f5c2363f72a68ec7081aa9db7017b9cb Mon Sep 17 00:00:00 2001 From: "B. Petersen" Date: Sat, 11 May 2024 20:02:00 +0200 Subject: [PATCH] fix showing input bar after forwarding this commit shows the forward-confirmation-alert to _after_ the view controller is really created. otherwise, on some iOS versions, the alert interferes with setting up the view controller in viewWillAppear closes #2153 --- deltachat-ios/Chat/ChatViewController.swift | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/deltachat-ios/Chat/ChatViewController.swift b/deltachat-ios/Chat/ChatViewController.swift index 775f4b0e7..17a959b1b 100644 --- a/deltachat-ios/Chat/ChatViewController.swift +++ b/deltachat-ios/Chat/ChatViewController.swift @@ -1370,14 +1370,17 @@ class ChatViewController: UITableViewController, UITableViewDropDelegate { RelayHelper.shared.forwardIdsAndFinishRelaying(to: self.chatId) refreshMessages() } else { - confirmationAlert(title: String.localizedStringWithFormat(String.localized("ask_forward"), chat.name), - actionTitle: String.localized("menu_forward"), - actionHandler: { _ in - RelayHelper.shared.forwardIdsAndFinishRelaying(to: self.chatId) - self.dismiss(animated: true, completion: nil)}, - cancelHandler: { _ in - self.dismiss(animated: false, completion: nil) - self.navigationController?.popViewController(animated: true)}) + DispatchQueue.main.async { [weak self] in + self?.confirmationAlert(title: String.localizedStringWithFormat(String.localized("ask_forward"), chat.name), + actionTitle: String.localized("menu_forward"), + actionHandler: { [weak self] _ in + guard let self else { return } + RelayHelper.shared.forwardIdsAndFinishRelaying(to: self.chatId) + }, + cancelHandler: { [weak self] _ in + self?.navigationController?.popViewController(animated: true) + }) + } } }