         touchIDTableViewCell.accessoryView = touchIDSwitch
         setPGPKeyTableViewCellDetailText()
         setPasswordRepositoryTableViewCellDetailText()
-        setTouchIDSwitch()
-        setPasscodeLockRepositoryTableViewCellDetailText()
-    }
-    
-    private func setPasscodeLockRepositoryTableViewCellDetailText() {
+        setPasscodeLockTouchIDCells()
+    }
+    
+    private func setPasscodeLockTouchIDCells() {
         if PasscodeLockRepository().hasPasscode {
             self.passcodeTableViewCell.detailTextLabel?.text = "On"
+            Globals.passcodeConfiguration.isTouchIDAllowed = true
+            touchIDSwitch.isOn = Defaults[.isTouchIDOn]
         } else {
             self.passcodeTableViewCell.detailTextLabel?.text = "Off"
-            touchIDSwitch.isEnabled = false
             Globals.passcodeConfiguration.isTouchIDAllowed = false
+            Defaults[.isTouchIDOn] = false
+            touchIDSwitch.isOn = Defaults[.isTouchIDOn]
         }
     }
     

        let optionMenu = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet)
        let removePasscodeAction = UIAlertAction(title: "Remove Passcode", style: .destructive) { [weak self] _ in
            passcodeRemoveViewController.successCallback  = { _ in
                self?.passcodeTableViewCell.detailTextLabel?.text = "Off"
                self?.touchIDSwitch.isEnabled = false
                let appDelegate = UIApplication.shared.delegate as! AppDelegate
                appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: Globals.passcodeConfiguration)
            }

        }
    }
    
    func actOnPasswordStoreErasedNotification() {
        setPGPKeyTableViewCellDetailText()
        setPasswordRepositoryTableViewCellDetailText()
        setPasscodeLockTouchIDCells()

        let appDelegate = UIApplication.shared.delegate as! AppDelegate
        appDelegate.passcodeLockPresenter = PasscodeLockPresenter(mainWindow: appDelegate.window, configuration: Globals.passcodeConfiguration)
