From fab0c435d1fb80713378ce66abcaea694b95a3a8 Mon Sep 17 00:00:00 2001 From: Avently Date: Mon, 26 Feb 2024 20:23:13 +0700 Subject: [PATCH] Revert "change instead of delete" This reverts commit 1195ee5b3088537b368e4547cb0ec1bdfe0a11da. --- apps/ios/Shared/AppDelegate.swift | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/apps/ios/Shared/AppDelegate.swift b/apps/ios/Shared/AppDelegate.swift index 30a4d5de1..2aab207d8 100644 --- a/apps/ios/Shared/AppDelegate.swift +++ b/apps/ios/Shared/AppDelegate.swift @@ -16,7 +16,7 @@ class AppDelegate: NSObject, UIApplicationDelegate { application.registerForRemoteNotifications() if #available(iOS 17.0, *) { trackKeyboard() } NotificationCenter.default.addObserver(self, selector: #selector(pasteboardChanged), name: UIPasteboard.changedNotification, object: nil) - changeAuthDetailsIfReinstalled() + removePasswordsIfReinstalled() return true } @@ -128,18 +128,14 @@ class AppDelegate: NSObject, UIApplicationDelegate { BGManager.shared.receiveMessages(complete) } - private func changeAuthDetailsIfReinstalled() { + private func removePasswordsIfReinstalled() { // check for database existence is needed because app password and self destruct password will be saved and restored // by iOS when a user deletes the app and installs it again. In this case database will be deleted but passwords are not. // This check ensures that the user will not stack on "Opening app..." screen if (kcAppPassword.get() != nil || kcSelfDestructPassword.get() != nil) && !UserDefaults.standard.bool(forKey: DEFAULT_PERFORM_LA) && !(hasDatabase() || hasLegacyDatabase()) { - if kcAppPassword.get() != nil { - UserDefaults.standard.setValue(true, forKey: DEFAULT_PERFORM_LA) - privacyLocalAuthModeDefault.set(.passcode) - } - if kcSelfDestructPassword.get() != nil { - UserDefaults.standard.setValue(true, forKey: DEFAULT_LA_SELF_DESTRUCT) - } + _ = kcAppPassword.remove() + _ = kcSelfDestructPassword.remove() + _ = kcDatabasePassword.remove() } }