From f167ab7549d71e0fcfefa6876703757c54eecb38 Mon Sep 17 00:00:00 2001 From: Danny Moesch Date: Sun, 26 Jul 2020 17:00:27 +0200 Subject: [PATCH] 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. --- pass/Controllers/PasswordsViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index 50e2631..0ad0ae9 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -257,7 +257,6 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV navigationItem.title = "PasswordStore".localize() tapNavigationBarGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(didTapNavigationBar)) - tableView.refreshControl = syncControl SVProgressHUD.setDefaultMaskType(.black) 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 tapNavigationBarGestureRecognizer.cancelsTouchesInView = false + + tableView.refreshControl = passwordStore.repositoryExists() ? syncControl : nil } override func viewWillDisappear(_ animated: Bool) {