@metamask-previews/approval-controller
Advanced tools
Comparing version 4.0.1-preview.0c0cc64 to 4.0.1-preview.578eb39
@@ -103,3 +103,5 @@ import type { RestrictedControllerMessenger } from '@metamask/base-controller'; | ||
}; | ||
export declare type StartFlowOptions = OptionalField<ApprovalFlow, 'id' | 'loadingText'>; | ||
export declare type StartFlowOptions = OptionalField<ApprovalFlow, 'id' | 'loadingText'> & { | ||
show?: boolean; | ||
}; | ||
export declare type EndFlowOptions = Pick<ApprovalFlow, 'id'>; | ||
@@ -220,3 +222,3 @@ export declare type SetFlowLoadingTextOptions = ApprovalFlow; | ||
* @param options.state - The initial controller state. | ||
* @param options.typesExcludedFromRateLimiting - Array of aproval types which allow multiple pending approval requests from the same origin. | ||
* @param options.typesExcludedFromRateLimiting - Array of approval types which allow multiple pending approval requests from the same origin. | ||
*/ | ||
@@ -398,2 +400,3 @@ constructor({ messenger, showApprovalRequest, state, typesExcludedFromRateLimiting, }: ApprovalControllerOptions); | ||
* @param opts.loadingText - The loading text that will be associated to the approval flow. | ||
* @param opts.show - A flag to determine whether the approval should show to the user. | ||
* @returns The object containing the approval flow id. | ||
@@ -400,0 +403,0 @@ */ |
@@ -66,3 +66,3 @@ "use strict"; | ||
* @param options.state - The initial controller state. | ||
* @param options.typesExcludedFromRateLimiting - Array of aproval types which allow multiple pending approval requests from the same origin. | ||
* @param options.typesExcludedFromRateLimiting - Array of approval types which allow multiple pending approval requests from the same origin. | ||
*/ | ||
@@ -300,2 +300,3 @@ constructor({ messenger, showApprovalRequest, state = {}, typesExcludedFromRateLimiting = [], }) { | ||
* @param opts.loadingText - The loading text that will be associated to the approval flow. | ||
* @param opts.show - A flag to determine whether the approval should show to the user. | ||
* @returns The object containing the approval flow id. | ||
@@ -310,3 +311,6 @@ */ | ||
}); | ||
__classPrivateFieldGet(this, _ApprovalController_showApprovalRequest, "f").call(this); | ||
// By default, if nothing else is specified, we always show the approval. | ||
if (opts.show !== false) { | ||
__classPrivateFieldGet(this, _ApprovalController_showApprovalRequest, "f").call(this); | ||
} | ||
return { id, loadingText }; | ||
@@ -313,0 +317,0 @@ } |
{ | ||
"name": "@metamask-previews/approval-controller", | ||
"version": "4.0.1-preview.0c0cc64", | ||
"version": "4.0.1-preview.578eb39", | ||
"description": "Manages requests that require user approval", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
"devDependencies": { | ||
"@metamask/auto-changelog": "^3.1.0", | ||
"@metamask/auto-changelog": "^3.4.0", | ||
"@types/jest": "^27.4.1", | ||
@@ -42,0 +42,0 @@ "deepmerge": "^4.2.2", |
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
109730
1005