Update Safari extension search logic #138

- Match the entered text in each pathname levels
This commit is contained in:
Yishi Lin 2017-10-28 15:32:30 +08:00
parent 3380f41855
commit 15ed7aaf2f
2 changed files with 22 additions and 9 deletions

View file

@ -22,6 +22,10 @@ extension PasswordEntity {
}
public func getCategoryText() -> String {
return getCategoryArray().joined(separator: " > ")
}
public func getCategoryArray() -> [String] {
var parentEntity = parent
var passwordCategoryArray: [String] = []
while parentEntity != nil {
@ -29,7 +33,7 @@ extension PasswordEntity {
parentEntity = parentEntity!.parent
}
passwordCategoryArray.reverse()
return passwordCategoryArray.joined(separator: " > ")
return passwordCategoryArray
}
public func getURL() -> URL? {