Show device unlinked message upon clearing secondary device

This commit is contained in:
nielsandriesse 2020-08-06 12:16:27 +10:00
parent 6984015aed
commit e648353453
2 changed files with 2 additions and 1 deletions

View File

@ -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"];

View File

@ -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)
}
}