Remove sync control if there is no repository set

If there is no local repository set we should not provide the possibility to sync it.
This commit is contained in:
Danny Moesch 2020-07-26 17:00:27 +02:00 committed by Mingshen Sun
parent b503e5f613
commit f167ab7549

View file

@ -257,7 +257,6 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
navigationItem.title = "PasswordStore".localize() navigationItem.title = "PasswordStore".localize()
tapNavigationBarGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapNavigationBar)) tapNavigationBarGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapNavigationBar))
tableView.refreshControl = syncControl
SVProgressHUD.setDefaultMaskType(.black) SVProgressHUD.setDefaultMaskType(.black)
tableView.register(UINib(nibName: "PasswordWithFolderTableViewCell", bundle: nil), forCellReuseIdentifier: "passwordWithFolderTableViewCell") tableView.register(UINib(nibName: "PasswordWithFolderTableViewCell", bundle: nil), forCellReuseIdentifier: "passwordWithFolderTableViewCell")
@ -315,6 +314,8 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV
// This allows controlls in the navigation bar to continue receiving touches // This allows controlls in the navigation bar to continue receiving touches
tapNavigationBarGestureRecognizer.cancelsTouchesInView = false tapNavigationBarGestureRecognizer.cancelsTouchesInView = false
tableView.refreshControl = passwordStore.repositoryExists() ? syncControl : nil
} }
override func viewWillDisappear(_ animated: Bool) { override func viewWillDisappear(_ animated: Bool) {