Reload password list when opening the app

Reason is that the state of the repository could have been changed in the background by the Siri shortcut.
This commit is contained in:
Danny Moesch 2020-03-16 22:24:56 +01:00 committed by Mingshen Sun
parent ac8dd40f2f
commit 54e104d2f0

View file

@ -249,6 +249,8 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
// reset the data table if the disaply settings have been changed
NotificationCenter.default.addObserver(self, selector: #selector(actOnReloadTableViewRelatedNotification), name: .passwordDisplaySettingChanged, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(actOnSearchNotification), name: .passwordSearch, object: nil)
// A Siri shortcut can change the state of the app in the background. Hence, reload when opening the app.
NotificationCenter.default.addObserver(self, selector: #selector(actOnReloadTableViewRelatedNotification), name: UIApplication.willEnterForegroundNotification, object: nil)
// listen to the swipe back guesture
let swipeRight = UISwipeGestureRecognizer(target: self, action: #selector(self.respondToSwipeGesture))