Polish the Password class

- About "additions", remove "additionKeys"
This commit is contained in:
Yishi Lin 2017-06-28 00:18:06 +08:00
parent 62136b0cfd
commit 69b58e686d
2 changed files with 35 additions and 38 deletions

View file

@ -278,17 +278,12 @@ class PasswordDetailTableViewController: UITableViewController, UIGestureRecogni
}
// show additional information
let filteredAdditionKeys = password.additionKeys.filter {
$0.lowercased() != "username" &&
$0.lowercased() != "password" &&
(!$0.hasPrefix("unknown") || !SharedDefaults[.isHideUnknownOn]) &&
(!Password.otpKeywords.contains($0) || !SharedDefaults[.isHideOTPOn]) }
let filteredAdditionKeys = password.getFilteredAdditions()
if filteredAdditionKeys.count > 0 {
section = TableSection(type: .addition, header: "additions")
for additionKey in filteredAdditionKeys {
section.item.append(TableCell(title: additionKey, content: password.additions[additionKey]!))
}
filteredAdditionKeys.forEach({ (key: String, value: String) in
section.item.append(TableCell(title: key, content: value))
})
tableData.append(section)
}