Fix open group config message syncing

pull/350/head
Niels Andriesse 5 years ago committed by nielsandriesse
parent e7b9017992
commit 517360a773

@ -132,10 +132,12 @@ final class JoinPublicChatVC : BaseVC, UIPageViewControllerDataSource, UIPageVie
} }
isJoining = true isJoining = true
ModalActivityIndicatorViewController.present(fromViewController: navigationController!, canCancel: false) { [weak self] _ in ModalActivityIndicatorViewController.present(fromViewController: navigationController!, canCancel: false) { [weak self] _ in
Storage.shared.write(with: { transaction in Storage.shared.write { transaction in
OpenGroupManager.shared.add(with: urlAsString, using: transaction) OpenGroupManager.shared.add(with: urlAsString, using: transaction)
.done(on: DispatchQueue.main) { [weak self] _ in .done(on: DispatchQueue.main) { [weak self] _ in
self?.presentingViewController!.dismiss(animated: true, completion: nil) self?.presentingViewController!.dismiss(animated: true, completion: nil)
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.forceSyncConfigurationNowIfNeeded().retainUntilComplete() // FIXME: It's probably cleaner to do this inside addOpenGroup(...)
} }
.catch(on: DispatchQueue.main) { [weak self] error in .catch(on: DispatchQueue.main) { [weak self] error in
self?.dismiss(animated: true, completion: nil) // Dismiss the loader self?.dismiss(animated: true, completion: nil) // Dismiss the loader
@ -148,10 +150,7 @@ final class JoinPublicChatVC : BaseVC, UIPageViewControllerDataSource, UIPageVie
self?.isJoining = false self?.isJoining = false
self?.showError(title: title, message: message) self?.showError(title: title, message: message)
} }
}, completion: { }
let appDelegate = UIApplication.shared.delegate as! AppDelegate
appDelegate.forceSyncConfigurationNowIfNeeded().retainUntilComplete() // FIXME: It's probably cleaner to do this inside addOpenGroup(...)
})
} }
} }

Loading…
Cancel
Save