Skip to content

Commit

Permalink
Pass TLD as parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
graeme committed Dec 9, 2024
1 parent 803f462 commit 8d54b6e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ final class PartialFormSaveManager {

private static var accounts: [String: WebsiteAccount] = .init()

private let tld: TLD

init(tld: TLD) {
self.tld = tld
}

func partialAccount(forDomain domain: String) -> WebsiteAccount? {
guard let tldPlus1 = TLD().eTLDplus1(domain) else {
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public class SecureVaultManager {
private var autogeneratedCredentials: Bool {
return autogeneratedUserName || autogeneratedPassword
}
private let partialFormSaveManager = PartialFormSaveManager()
private let partialFormSaveManager: PartialFormSaveManager

public lazy var autofillWebsiteAccountMatcher: AutofillWebsiteAccountMatcher? = {
guard let tld = tld else { return nil }
Expand All @@ -141,6 +141,11 @@ public class SecureVaultManager {
self.includePartialAccountMatches = includePartialAccountMatches
self.shouldAllowPartialFormSaves = shouldAllowPartialFormSaves
self.tld = tld
if let tld {
partialFormSaveManager = PartialFormSaveManager(tld: tld)
} else {
partialFormSaveManager = PartialFormSaveManager(tld: TLD())
}
}

}
Expand Down

0 comments on commit 8d54b6e

Please sign in to comment.