From 54e104d2f081d1b057581a4023a23fbb1cd21d87 Mon Sep 17 00:00:00 2001 From: Danny Moesch Date: Mon, 16 Mar 2020 22:24:56 +0100 Subject: [PATCH] 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. --- pass/Controllers/PasswordsViewController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index 6f40678..5421454 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -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))