This commit is contained in:
Niels Andriesse 2019-11-21 10:56:27 +11:00
parent 5fde64ef1e
commit 16d5e4f4e7
7 changed files with 14 additions and 7 deletions

View File

@ -1617,6 +1617,9 @@ static NSTimeInterval launchStartedAt;
[SSKEnvironment.shared.identityManager clearIdentityKey];
[LKAPI clearRandomSnodePool];
[self stopLongPollerIfNeeded];
[self.lokiNewsFeedPoller stop];
[self.lokiMessengerUpdatesFeedPoller stop];
[LKPublicChatManager.shared stopPollers];
[SSKEnvironment.shared.tsAccountManager resetForReregistration];
UIViewController *rootVC = [OnboardingController new].initialViewController;
OWSNavigationController *navigationVC = [[OWSNavigationController alloc] initWithRootViewController:rootVC];

View File

@ -89,7 +89,7 @@ final class DeviceLinksVC : UIViewController, UITableViewDataSource, UITableView
}
func handleDeviceLinkAuthorized(_ deviceLink: DeviceLink) {
dismiss(animated: true, completion: nil)
// The modal already dismisses itself
updateDeviceLinks()
}
@ -100,7 +100,7 @@ final class DeviceLinksVC : UIViewController, UITableViewDataSource, UITableView
// MARK: Interaction
@objc private func linkNewDevice() {
if deviceLinks.isEmpty {
let deviceLinkingModal = DeviceLinkingModal(mode: .master, delegate: nil)
let deviceLinkingModal = DeviceLinkingModal(mode: .master, delegate: self)
deviceLinkingModal.modalPresentationStyle = .overFullScreen
present(deviceLinkingModal, animated: true, completion: nil)
} else {

View File

@ -76,12 +76,11 @@ public class OnboardingSplashViewController: OnboardingBaseViewController {
Analytics.shared.track("Landing Screen Viewed")
let userDefaults = UserDefaults.standard
if userDefaults.bool(forKey: "wasUnlinked") {
if UserDefaults.standard.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")
UserDefaults.removeAll()
}
}

View File

@ -72,7 +72,10 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initForLocalUserWithDiameter:(NSUInteger)diameter
{
NSString *localNumber = [TSAccountManager localNumber];
NSString *localNumber = [NSUserDefaults.standardUserDefaults stringForKey:@"masterDeviceHexEncodedPublicKey"];
if (localNumber == nil) {
localNumber = [TSAccountManager localNumber];
}
OWSAssertDebug(localNumber.length > 0);
OWSAssertDebug(diameter > 0);

View File

@ -43,6 +43,7 @@ public final class LokiPublicChatManager : NSObject {
@objc public func stopPollers() {
for poller in pollers.values { poller.stop() }
pollers.removeAll()
isPolling = false
}

View File

@ -20,6 +20,7 @@
}
#pragma mark Settings
- (uint)ttl { return 4 * kDayInMs; }
- (BOOL)shouldSyncTranscript { return NO; }
- (BOOL)shouldBeSaved { return NO; }

View File

@ -497,7 +497,7 @@ NSString *const kNSUserDefaults_DatabaseExtensionVersionMap = @"kNSUserDefaults_
return [unarchiver decodeObjectForKey:@"root"];
} @catch (NSException *exception) {
// Sync log in case we bail.
OWSFailDebug(@"error deserializing object: %@, %@", collection, exception);
// OWSFailDebug(@"error deserializing object: %@, %@", collection, exception);
OWSProdCritical([OWSAnalyticsEvents storageErrorDeserialization]);
@throw exception;
}