mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Notify user after device has been unlinked
This commit is contained in:
parent
592aa70862
commit
31e3a98d90
|
@ -75,6 +75,14 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
|
||||||
lokiLogoImageView.autoCenterInSuperview()
|
lokiLogoImageView.autoCenterInSuperview()
|
||||||
|
|
||||||
Analytics.shared.track("Landing Screen Viewed")
|
Analytics.shared.track("Landing Screen Viewed")
|
||||||
|
|
||||||
|
let userDefaults = UserDefaults.standard
|
||||||
|
if userDefaults.bool(forKey: "wasUnlinked") {
|
||||||
|
let alert = UIAlertController(title: NSLocalizedString("Device Unlinked", comment: ""), message: NSLocalizedString("Your device was unlinked successfully", comment: ""), preferredStyle: .alert)
|
||||||
|
alert.addAction(UIAlertAction(title: NSLocalizedString("OK", comment: ""), accessibilityIdentifier: nil, style: .default, handler: nil))
|
||||||
|
present(alert, animated: true, completion: nil)
|
||||||
|
userDefaults.set(false, forKey: "wasUnlinked")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Events
|
// MARK: - Events
|
||||||
|
|
|
@ -2667,3 +2667,5 @@
|
||||||
"Please pick a name" = "Please pick a name";
|
"Please pick a name" = "Please pick a name";
|
||||||
"Couldn't Unlink Device" = "Couldn't Unlink Device";
|
"Couldn't Unlink Device" = "Couldn't Unlink Device";
|
||||||
"Please check your internet connection and try again" = "Please check your internet connection and try again";
|
"Please check your internet connection and try again" = "Please check your internet connection and try again";
|
||||||
|
"Device Unlinked" = "Device Unlinked";
|
||||||
|
"Your device was unlinked successfully" = "Your device was unlinked successfully";
|
||||||
|
|
|
@ -1199,6 +1199,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||||
if (![deviceLinks contains:^BOOL(LKDeviceLink *deviceLink) {
|
if (![deviceLinks contains:^BOOL(LKDeviceLink *deviceLink) {
|
||||||
return [deviceLink.master.hexEncodedPublicKey isEqual:senderHexEncodedPublicKey] && [deviceLink.slave.hexEncodedPublicKey isEqual:userHexEncodedPublicKey];
|
return [deviceLink.master.hexEncodedPublicKey isEqual:senderHexEncodedPublicKey] && [deviceLink.slave.hexEncodedPublicKey isEqual:userHexEncodedPublicKey];
|
||||||
}]) {
|
}]) {
|
||||||
|
[NSUserDefaults.standardUserDefaults setBool:YES forKey:@"wasUnlinked"];
|
||||||
[NSNotificationCenter.defaultCenter postNotification:NSNotification.dataNukeRequested];
|
[NSNotificationCenter.defaultCenter postNotification:NSNotification.dataNukeRequested];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue