-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PM-5559] Implement User Notification Settings state provider (#8032)
* create user notification settings state provider * replace state service get/set disableAddLoginNotification and disableChangedPasswordNotification with user notification settings service equivalents * migrate disableAddLoginNotification and disableChangedPasswordNotification global settings to user notification settings state provider * add content script messaging the background for enableChangedPasswordPrompt setting * Implementing feedback to provide on PR * Implementing feedback to provide on PR * PR suggestions cleanup --------- Co-authored-by: Cesar Gonzalez <cgonzalez@bitwarden.com>
- Loading branch information
Showing
18 changed files
with
409 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
...r/src/autofill/background/service_factories/user-notification-settings-service.factory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { UserNotificationSettingsService } from "@bitwarden/common/autofill/services/user-notification-settings.service"; | ||
|
||
import { | ||
CachedServices, | ||
factory, | ||
FactoryOptions, | ||
} from "../../../platform/background/service-factories/factory-options"; | ||
import { | ||
stateProviderFactory, | ||
StateProviderInitOptions, | ||
} from "../../../platform/background/service-factories/state-provider.factory"; | ||
|
||
export type UserNotificationSettingsServiceInitOptions = FactoryOptions & StateProviderInitOptions; | ||
|
||
export function userNotificationSettingsServiceFactory( | ||
cache: { userNotificationSettingsService?: UserNotificationSettingsService } & CachedServices, | ||
opts: UserNotificationSettingsServiceInitOptions, | ||
): Promise<UserNotificationSettingsService> { | ||
return factory( | ||
cache, | ||
"userNotificationSettingsService", | ||
opts, | ||
async () => new UserNotificationSettingsService(await stateProviderFactory(cache, opts)), | ||
); | ||
} |
Oops, something went wrong.