Show number of hidden fields in password view

This commit is contained in:
Danny Moesch 2018-12-08 00:57:54 +01:00 committed by Bob Sun
parent 68dd60fb8e
commit 5780a439db
2 changed files with 27 additions and 1 deletions

View file

@ -59,6 +59,14 @@ public class Password {
return otpToken?.currentPassword
}
public var numberOfUnknowns: Int {
return additions.map { $0.title }.filter(Constants.isUnknown).count
}
public var numberOfOtpRelated: Int {
return additions.map { $0.title }.filter(Constants.isOtpKeyword).count - (firstLineIsOTPField ? 1 : 0)
}
public init(name: String, url: URL, plainText: String) {
self.name = name
self.url = url