diff --git a/Signal/src/Loki/Settings/DeviceLinkingModal.swift b/Signal/src/Loki/Settings/DeviceLinkingModal.swift index d15a26871..8110bbfeb 100644 --- a/Signal/src/Loki/Settings/DeviceLinkingModal.swift +++ b/Signal/src/Loki/Settings/DeviceLinkingModal.swift @@ -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).") } diff --git a/Signal/src/Loki/Settings/DeviceLinksVC.swift b/Signal/src/Loki/Settings/DeviceLinksVC.swift index 9a8d51b77..557231b39 100644 --- a/Signal/src/Loki/Settings/DeviceLinksVC.swift +++ b/Signal/src/Loki/Settings/DeviceLinksVC.swift @@ -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() {