From 2d6ad7f6ca38eca8d30d046a4f548e1ae7dfed3b Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 3 Dec 2019 22:52:14 -0400 Subject: [PATCH] Update permissions request parameter names and docs (#7636) The parameter names and JSDoc comments for `approvePermissionsRequest` and `rejectPermissionsRequest` were incorrect in a few places. --- app/scripts/controllers/permissions/index.js | 3 ++- .../permissions-connect.component.js | 4 ++-- .../permissions-connect.container.js | 2 +- ui/app/store/actions.js | 12 ++++++------ 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/app/scripts/controllers/permissions/index.js b/app/scripts/controllers/permissions/index.js index 899044b13..de1c472e4 100644 --- a/app/scripts/controllers/permissions/index.js +++ b/app/scripts/controllers/permissions/index.js @@ -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) { diff --git a/ui/app/pages/permissions-connect/permissions-connect.component.js b/ui/app/pages/permissions-connect/permissions-connect.component.js index 69dcbd390..e09fe5fab 100644 --- a/ui/app/pages/permissions-connect/permissions-connect.component.js +++ b/ui/app/pages/permissions-connect/permissions-connect.component.js @@ -186,8 +186,8 @@ export default class PermissionConnect extends Component {
{ - approvePermissionsRequest(requestId, accounts) + approvePermissionsRequest={(request, accounts) => { + approvePermissionsRequest(request, accounts) this.redirectFlow(true) }} rejectPermissionsRequest={requestId => { diff --git a/ui/app/pages/permissions-connect/permissions-connect.container.js b/ui/app/pages/permissions-connect/permissions-connect.container.js index 1209bd9cc..143cc6fbc 100644 --- a/ui/app/pages/permissions-connect/permissions-connect.container.js +++ b/ui/app/pages/permissions-connect/permissions-connect.container.js @@ -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({ diff --git a/ui/app/store/actions.js b/ui/app/store/actions.js index d81769f01..e29bb57b7 100644 --- a/ui/app/store/actions.js +++ b/ui/app/store/actions.js @@ -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 () => {