From 0efb646bb7c88423a6e025347eb2aee313ae72d5 Mon Sep 17 00:00:00 2001 From: nielsandriesse Date: Mon, 28 Sep 2020 14:32:35 +1000 Subject: [PATCH] Debug --- .../src/Loki/View Controllers/EditClosedGroupVC.swift | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Signal/src/Loki/View Controllers/EditClosedGroupVC.swift b/Signal/src/Loki/View Controllers/EditClosedGroupVC.swift index 4b43d1c8f..86627dbf4 100644 --- a/Signal/src/Loki/View Controllers/EditClosedGroupVC.swift +++ b/Signal/src/Loki/View Controllers/EditClosedGroupVC.swift @@ -232,10 +232,14 @@ final class EditClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelega let members = Set(self.members) let name = self.name try! Storage.writeSync { [weak self] transaction in - ClosedGroupsProtocol.update(groupPublicKey, with: members, name: name, transaction: transaction).done { + ClosedGroupsProtocol.update(groupPublicKey, with: members, name: name, transaction: transaction).done(on: DispatchQueue.main) { guard let self = self else { return } - self.navigationController!.popViewController(animated: true) - }.catch { error in + if let conversationVC = self.navigationController!.viewControllers.first(where: { $0 is ConversationViewController }) { + self.navigationController!.popToViewController(conversationVC, animated: true) + } else { + self.navigationController!.popViewController(animated: true) + } + }.catch(on: DispatchQueue.main) { error in guard let self = self else { return } self.showError(title: "Couldn't Update Group", message: "Please check your internet connection and try again.") }