|
|
@ -241,16 +241,20 @@ final class EditClosedGroupVC : BaseVC, UITableViewDataSource, UITableViewDelega
|
|
|
|
guard members != Set(thread.groupModel.groupMemberIds) || name != thread.groupModel.groupName else {
|
|
|
|
guard members != Set(thread.groupModel.groupMemberIds) || name != thread.groupModel.groupName else {
|
|
|
|
return popToConversationVC(self)
|
|
|
|
return popToConversationVC(self)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ModalActivityIndicatorViewController.present(fromViewController: navigationController!, canCancel: false) { [weak self] _ in
|
|
|
|
try! Storage.writeSync { [weak self] transaction in
|
|
|
|
try! Storage.writeSync { [weak self] transaction in
|
|
|
|
ClosedGroupsProtocol.update(groupPublicKey, with: members, name: name, transaction: transaction).done(on: DispatchQueue.main) {
|
|
|
|
ClosedGroupsProtocol.update(groupPublicKey, with: members, name: name, transaction: transaction).done(on: DispatchQueue.main) {
|
|
|
|
guard let self = self else { return }
|
|
|
|
guard let self = self else { return }
|
|
|
|
|
|
|
|
self.dismiss(animated: true, completion: nil) // Dismiss the loader
|
|
|
|
popToConversationVC(self)
|
|
|
|
popToConversationVC(self)
|
|
|
|
}.catch(on: DispatchQueue.main) { error in
|
|
|
|
}.catch(on: DispatchQueue.main) { error in
|
|
|
|
guard let self = self else { return }
|
|
|
|
guard let self = self else { return }
|
|
|
|
|
|
|
|
self.dismiss(animated: true, completion: nil) // Dismiss the loader
|
|
|
|
self.showError(title: "Couldn't Update Group", message: "Please check your internet connection and try again.")
|
|
|
|
self.showError(title: "Couldn't Update Group", message: "Please check your internet connection and try again.")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MARK: Convenience
|
|
|
|
// MARK: Convenience
|
|
|
|
private func showError(title: String, message: String = "") {
|
|
|
|
private func showError(title: String, message: String = "") {
|
|
|
|