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 stopOpenGroupPollers];
|
||||
[LKPublicChatManager.shared stopPollers];
|
||||
bool wasUnlinked = [NSUserDefaults.standardUserDefaults boolForKey:@"wasUnlinked"];
|
||||
BOOL wasUnlinked = [NSUserDefaults.standardUserDefaults boolForKey:@"wasUnlinked"];
|
||||
[SignalApp resetAppData:^{
|
||||
// Resetting the data clears the old user defaults. We need to restore the unlink default.
|
||||
[NSUserDefaults.standardUserDefaults setBool:wasUnlinked forKey:@"wasUnlinked"];
|
||||
|
|
|
@ -175,6 +175,7 @@ final class HomeVC : BaseVC, UITableViewDataSource, UITableViewDelegate, UIScrol
|
|||
reload()
|
||||
// Clear all data if this is a secondary device
|
||||
if UserDefaults.standard[.masterHexEncodedPublicKey] != nil {
|
||||
UserDefaults.standard[.wasUnlinked] = true
|
||||
NotificationCenter.default.post(name: .dataNukeRequested, object: nil, userInfo: nil)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue