mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 01:39:44 +01:00
Update permissions request parameter names and docs (#7636)
The parameter names and JSDoc comments for `approvePermissionsRequest` and `rejectPermissionsRequest` were incorrect in a few places.
This commit is contained in:
parent
638e242ce6
commit
2d6ad7f6ca
@ -133,7 +133,8 @@ class PermissionsController {
|
||||
/**
|
||||
* User approval callback. The request can fail if the request is invalid.
|
||||
*
|
||||
* @param {object} approved the approved request object
|
||||
* @param {object} approved - the approved request object
|
||||
* @param {Array} accounts - The accounts to expose, if any
|
||||
*/
|
||||
async approvePermissionsRequest (approved, accounts) {
|
||||
|
||||
|
@ -186,8 +186,8 @@ export default class PermissionConnect extends Component {
|
||||
<div>
|
||||
<PermissionPageContainer
|
||||
request={permissionsRequest || {}}
|
||||
approvePermissionsRequest={ (requestId, accounts) => {
|
||||
approvePermissionsRequest(requestId, accounts)
|
||||
approvePermissionsRequest={(request, accounts) => {
|
||||
approvePermissionsRequest(request, accounts)
|
||||
this.redirectFlow(true)
|
||||
}}
|
||||
rejectPermissionsRequest={requestId => {
|
||||
|
@ -46,7 +46,7 @@ const mapStateToProps = state => {
|
||||
|
||||
const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
approvePermissionsRequest: (requestId, accounts) => dispatch(approvePermissionsRequest(requestId, accounts)),
|
||||
approvePermissionsRequest: (request, accounts) => dispatch(approvePermissionsRequest(request, accounts)),
|
||||
rejectPermissionsRequest: requestId => dispatch(rejectPermissionsRequest(requestId)),
|
||||
showNewAccountModal: ({ onCreateNewAccount, newAccountNumber }) => {
|
||||
return dispatch(showModal({
|
||||
|
@ -2718,19 +2718,19 @@ function setPendingTokens (pendingTokens) {
|
||||
// Permissions
|
||||
|
||||
/**
|
||||
* Approves the permission requests with the given IDs.
|
||||
* @param {string} requestId - The id of the permissions request.
|
||||
* Approves the permissions request.
|
||||
* @param {Object} request - The permissions request to approve
|
||||
* @param {string[]} accounts - The accounts to expose, if any.
|
||||
*/
|
||||
function approvePermissionsRequest (requestId, accounts) {
|
||||
function approvePermissionsRequest (request, accounts) {
|
||||
return () => {
|
||||
background.approvePermissionsRequest(requestId, accounts)
|
||||
background.approvePermissionsRequest(request, accounts)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Rejects the permission requests with the given IDs.
|
||||
* @param {Array} requestId
|
||||
* Rejects the permissions request with the given ID.
|
||||
* @param {string} requestId - The id of the request to be rejected
|
||||
*/
|
||||
function rejectPermissionsRequest (requestId) {
|
||||
return () => {
|
||||
|
Loading…
Reference in New Issue
Block a user