mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
Show device unlinked message upon clearing secondary device
This commit is contained in:
parent
6984015aed
commit
e648353453
|
@ -952,7 +952,7 @@ static NSTimeInterval launchStartedAt;
|
||||||
[self stopClosedGroupPoller];
|
[self stopClosedGroupPoller];
|
||||||
[self stopOpenGroupPollers];
|
[self stopOpenGroupPollers];
|
||||||
[LKPublicChatManager.shared stopPollers];
|
[LKPublicChatManager.shared stopPollers];
|
||||||
bool wasUnlinked = [NSUserDefaults.standardUserDefaults boolForKey:@"wasUnlinked"];
|
BOOL wasUnlinked = [NSUserDefaults.standardUserDefaults boolForKey:@"wasUnlinked"];
|
||||||
[SignalApp resetAppData:^{
|
[SignalApp resetAppData:^{
|
||||||
// Resetting the data clears the old user defaults. We need to restore the unlink default.
|
// Resetting the data clears the old user defaults. We need to restore the unlink default.
|
||||||
[NSUserDefaults.standardUserDefaults setBool:wasUnlinked forKey:@"wasUnlinked"];
|
[NSUserDefaults.standardUserDefaults setBool:wasUnlinked forKey:@"wasUnlinked"];
|
||||||
|
|
|
@ -175,6 +175,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol
|
||||||
reload()
|
reload()
|
||||||
// Clear all data if this is a secondary device
|
// Clear all data if this is a secondary device
|
||||||
if UserDefaults.standard[.masterHexEncodedPublicKey] != nil {
|
if UserDefaults.standard[.masterHexEncodedPublicKey] != nil {
|
||||||
|
UserDefaults.standard[.wasUnlinked] = true
|
||||||
NotificationCenter.default.post(name: .dataNukeRequested, object: nil, userInfo: nil)
|
NotificationCenter.default.post(name: .dataNukeRequested, object: nil, userInfo: nil)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue