Fix UI glitch

pull/70/head
Niels Andriesse 5 years ago
parent 3322ab49b7
commit d62bfa853f

@ -145,8 +145,8 @@ final class DeviceLinkingModal : Modal, DeviceLinkingSessionDelegate {
dismiss(animated: true, completion: nil)
let master = DeviceLink.Device(hexEncodedPublicKey: deviceLink.master.hexEncodedPublicKey, signature: linkingAuthorizationMessage.masterSignature)
let signedDeviceLink = DeviceLink(between: master, and: deviceLink.slave)
LokiStorageAPI.addDeviceLink(signedDeviceLink).done { [weak self] in
self?.delegate?.handleDeviceLinkAuthorized(signedDeviceLink)
LokiStorageAPI.addDeviceLink(signedDeviceLink).done {
self.delegate?.handleDeviceLinkAuthorized(signedDeviceLink) // Intentionally capture self strongly
}.catch { error in
print("[Loki] Failed to add device link due to error: \(error).")
}

@ -90,9 +90,7 @@ final class DeviceLinksVC : UIViewController, UITableViewDataSource, UITableView
func handleDeviceLinkAuthorized(_ deviceLink: DeviceLink) {
// The modal already dismisses itself
// FIXME: Somehow calling updateDeviceLinks() is unreliable here
deviceLinks.append(deviceLink)
updateUI()
updateDeviceLinks()
}
func handleDeviceLinkingModalDismissed() {

Loading…
Cancel
Save