1
0
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:
Mark Stacey 2019-12-03 22:52:14 -04:00 committed by GitHub
parent 638e242ce6
commit 2d6ad7f6ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 10 deletions

View File

@ -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) {

View File

@ -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 => {

View File

@ -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({

View File

@ -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 () => {