diff options
Diffstat (limited to 'ios')
| -rw-r--r-- | ios/MullvadVPN/WireguardKeysViewController.swift | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ios/MullvadVPN/WireguardKeysViewController.swift b/ios/MullvadVPN/WireguardKeysViewController.swift index 1bfc367f63..3ce6ac3e5f 100644 --- a/ios/MullvadVPN/WireguardKeysViewController.swift +++ b/ios/MullvadVPN/WireguardKeysViewController.swift @@ -110,12 +110,14 @@ class WireguardKeysViewController: UIViewController { animated: true) copyToPasteboardSubscriber = - Just(publicKey).cancellableDelay(for: .seconds(3), scheduler: DispatchQueue.main) - .sink(receiveValue: { [weak self] (publicKey) in + Just(()).cancellableDelay(for: .seconds(3), scheduler: DispatchQueue.main) + .sink(receiveValue: { [weak self] () in + guard let self = self, let publicKey = self.publicKey else { return } + let displayKey = publicKey .stringRepresentation(maxLength: kDisplayPublicKeyMaxLength) - self?.setPublicKeyTitle(string: displayKey, animated: true) + self.setPublicKeyTitle(string: displayKey, animated: true) }) } |
