From 37fd6bf105c45a5570eb755c76f49b9344e4a4ba Mon Sep 17 00:00:00 2001 From: Anya Mallon Date: Wed, 22 May 2024 16:53:53 +0200 Subject: [PATCH] Fill and save event notifications for when users on clients choose autogenerated credentials --- Sources/BrowserServicesKit/SecureVault/SecureVaultManager.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/BrowserServicesKit/SecureVault/SecureVaultManager.swift b/Sources/BrowserServicesKit/SecureVault/SecureVaultManager.swift index eda3a4569..8fd8f3ebd 100644 --- a/Sources/BrowserServicesKit/SecureVault/SecureVaultManager.swift +++ b/Sources/BrowserServicesKit/SecureVault/SecureVaultManager.swift @@ -246,6 +246,7 @@ extension SecureVaultManager: AutofillSecureVaultDelegate { if autofilldata.trigger == .passwordGeneration { autogeneratedPassword = data.credentials?.autogenerated ?? false + NotificationCenter.default.post(name: .autofillFillEvent, object: nil) } // Account for cases when the user has manually changed an autogenerated password or private email @@ -616,6 +617,7 @@ extension SecureVaultManager: AutofillSecureVaultDelegate { var account = SecureVaultModels.WebsiteAccount(username: username, domain: domain, lastUsed: Date()) let credentials = try? vault?.storeWebsiteCredentials(SecureVaultModels.WebsiteCredentials(account: account, password: password)) account.id = String(credentials ?? -1) + NotificationCenter.default.post(name: .autofillSaveEvent, object: nil, userInfo: nil) return account }