|
|
|
@ -1638,22 +1638,12 @@ static NSTimeInterval launchStartedAt;
|
|
|
|
|
[self stopLongPollerIfNeeded];
|
|
|
|
|
[self.lokiNewsFeedPoller stop];
|
|
|
|
|
[self.lokiMessengerUpdatesFeedPoller stop];
|
|
|
|
|
[OWSPrimaryStorage.sharedManager.dbReadWriteConnection readWriteWithBlock:^(YapDatabaseReadWriteTransaction *transaction) {
|
|
|
|
|
[transaction removeAllObjectsInCollection:LKPublicChatAPI.lastMessageServerIDCollection];
|
|
|
|
|
[transaction removeAllObjectsInCollection:LKPublicChatAPI.lastDeletionServerIDCollection];
|
|
|
|
|
[transaction removeAllObjectsInCollection:@"LKMessageIDCollection"];
|
|
|
|
|
[transaction removeAllObjectsInCollection:@"LKLastMessageHashCollection"];
|
|
|
|
|
NSDictionary<NSString *, LKPublicChat *> *allPublicChats = [LKDatabaseUtilities getAllPublicChats:transaction];
|
|
|
|
|
for (NSString *threadID in allPublicChats.allKeys) {
|
|
|
|
|
[LKDatabaseUtilities removePublicChatForThreadID:threadID transaction:transaction];
|
|
|
|
|
}
|
|
|
|
|
}];
|
|
|
|
|
[LKPublicChatManager.shared stopPollers];
|
|
|
|
|
[SSKEnvironment.shared.tsAccountManager resetForReregistration];
|
|
|
|
|
UIViewController *rootVC = [OnboardingController new].initialViewController;
|
|
|
|
|
OWSNavigationController *navigationVC = [[OWSNavigationController alloc] initWithRootViewController:rootVC];
|
|
|
|
|
[navigationVC setNavigationBarHidden:YES];
|
|
|
|
|
UIApplication.sharedApplication.keyWindow.rootViewController = navigationVC;
|
|
|
|
|
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"];
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|