diff --git a/pass/Controllers/PasswordsViewController.swift b/pass/Controllers/PasswordsViewController.swift index 55380f3..c4e18c8 100644 --- a/pass/Controllers/PasswordsViewController.swift +++ b/pass/Controllers/PasswordsViewController.swift @@ -263,18 +263,16 @@ class PasswordsViewController: UIViewController, UITableViewDataSource, UITableV let cell = tableView.dequeueReusableCell(withIdentifier: "passwordTableViewCell", for: indexPath) let entry = getPasswordEntry(by: indexPath) + if entry.passwordEntity!.synced { + cell.textLabel?.text = entry.title + } else { + cell.textLabel?.text = "↻ \(entry.title)" + } if !entry.isDir { - if entry.passwordEntity!.synced { - cell.textLabel?.text = entry.title - } else { - cell.textLabel?.text = "↻ \(entry.title)" - } - cell.addGestureRecognizer(longPressGestureRecognizer) cell.accessoryType = .none cell.detailTextLabel?.text = "" } else { - cell.textLabel?.text = "\(entry.title)" cell.accessoryType = .disclosureIndicator cell.detailTextLabel?.font = UIFont.preferredFont(forTextStyle: .body) cell.detailTextLabel?.text = "\(entry.passwordEntity?.children?.count ?? 0)" diff --git a/passKit/Models/PasswordStore.swift b/passKit/Models/PasswordStore.swift index 45ec596..5b98c0e 100644 --- a/passKit/Models/PasswordStore.swift +++ b/passKit/Models/PasswordStore.swift @@ -471,17 +471,6 @@ public class PasswordStore { } } - public func getNumberOfUnsyncedPasswords() -> Int { - let passwordEntityFetchRequest = NSFetchRequest(entityName: "PasswordEntity") - do { - passwordEntityFetchRequest.predicate = NSPredicate(format: "synced = %i", 0) - return try context.count(for: passwordEntityFetchRequest) - } catch { - fatalError("Failed to fetch unsynced passwords: \(error)") - } - } - - public func getLatestUpdateInfo(filename: String) -> String { guard let storeRepository = storeRepository else { return "Unknown" @@ -622,6 +611,7 @@ public class PasswordStore { if let passwordEntity = getPasswordEntity(by: path, isDir: isDir) { print(passwordEntity.path!) parentPasswordEntity = passwordEntity + passwordEntity.synced = false } else { if !isDir { return insertPasswordEntity(name: URL(string: path.stringByAddingPercentEncodingForRFC3986()!)!.deletingPathExtension().lastPathComponent, path: path, parent: parentPasswordEntity, synced: false, isDir: false)