@metamask/preferences-controller
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -9,2 +9,6 @@ # Changelog | ||
## [4.3.0] | ||
### Added | ||
- Add preference for security alerts ([#1589](https://github.com/MetaMask/core/pull/1589)) | ||
## [4.2.0] | ||
@@ -54,3 +58,4 @@ ### Added | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@4.2.0...HEAD | ||
[Unreleased]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@4.3.0...HEAD | ||
[4.3.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@4.2.0...@metamask/preferences-controller@4.3.0 | ||
[4.2.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@4.1.0...@metamask/preferences-controller@4.2.0 | ||
@@ -57,0 +62,0 @@ [4.1.0]: https://github.com/MetaMask/core/compare/@metamask/preferences-controller@4.0.0...@metamask/preferences-controller@4.1.0 |
@@ -1,2 +0,3 @@ | ||
import { BaseController, BaseConfig, BaseState } from '@metamask/base-controller'; | ||
import type { BaseConfig, BaseState } from '@metamask/base-controller'; | ||
import { BaseController } from '@metamask/base-controller'; | ||
/** | ||
@@ -38,2 +39,3 @@ * ContactEntry representation. | ||
openSeaEnabled: boolean; | ||
securityAlertsEnabled: boolean; | ||
isMultiAccountBalancesEnabled: boolean; | ||
@@ -132,2 +134,8 @@ disabledRpcMethodPreferences: { | ||
/** | ||
* Toggle the security alert enabled setting. | ||
* | ||
* @param securityAlertsEnabled - Boolean indicating user preference on using security alerts. | ||
*/ | ||
setSecurityAlertsEnabled(securityAlertsEnabled: boolean): void; | ||
/** | ||
* A setter for the user preferences to enable/disable rpc methods. | ||
@@ -134,0 +142,0 @@ * |
@@ -31,2 +31,3 @@ "use strict"; | ||
openSeaEnabled: false, | ||
securityAlertsEnabled: false, | ||
isMultiAccountBalancesEnabled: true, | ||
@@ -113,3 +114,3 @@ disabledRpcMethodPreferences: { | ||
for (const identity in identities) { | ||
if (addresses.indexOf(identity) === -1) { | ||
if (!addresses.includes(identity)) { | ||
newlyLost[identity] = identities[identity]; | ||
@@ -129,3 +130,3 @@ delete identities[identity]; | ||
this.addIdentities(addresses); | ||
if (addresses.indexOf(this.state.selectedAddress) === -1) { | ||
if (!addresses.includes(this.state.selectedAddress)) { | ||
this.update({ selectedAddress: addresses[0] }); | ||
@@ -206,2 +207,10 @@ } | ||
/** | ||
* Toggle the security alert enabled setting. | ||
* | ||
* @param securityAlertsEnabled - Boolean indicating user preference on using security alerts. | ||
*/ | ||
setSecurityAlertsEnabled(securityAlertsEnabled) { | ||
this.update({ securityAlertsEnabled }); | ||
} | ||
/** | ||
* A setter for the user preferences to enable/disable rpc methods. | ||
@@ -208,0 +217,0 @@ * |
{ | ||
"name": "@metamask/preferences-controller", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "Manages user-configurable settings for MetaMask", | ||
@@ -32,4 +32,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@metamask/base-controller": "^3.0.0", | ||
"@metamask/controller-utils": "^4.1.0" | ||
"@metamask/base-controller": "^3.2.0", | ||
"@metamask/controller-utils": "^4.3.1" | ||
}, | ||
@@ -36,0 +36,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
39657
416