Update permissions request parameter names and docs (#7636)

The parameter names and JSDoc comments for `approvePermissionsRequest`
and `rejectPermissionsRequest` were incorrect in a few places.
feature/default_network_editable
Mark Stacey 5 years ago committed by GitHub
parent 638e242ce6
commit 2d6ad7f6ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/scripts/controllers/permissions/index.js
  2. 4
      ui/app/pages/permissions-connect/permissions-connect.component.js
  3. 2
      ui/app/pages/permissions-connect/permissions-connect.container.js
  4. 12
      ui/app/store/actions.js

@ -133,7 +133,8 @@ class PermissionsController {
/** /**
* User approval callback. The request can fail if the request is invalid. * 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) { async approvePermissionsRequest (approved, accounts) {

@ -186,8 +186,8 @@ export default class PermissionConnect extends Component {
<div> <div>
<PermissionPageContainer <PermissionPageContainer
request={permissionsRequest || {}} request={permissionsRequest || {}}
approvePermissionsRequest={ (requestId, accounts) => { approvePermissionsRequest={(request, accounts) => {
approvePermissionsRequest(requestId, accounts) approvePermissionsRequest(request, accounts)
this.redirectFlow(true) this.redirectFlow(true)
}} }}
rejectPermissionsRequest={requestId => { rejectPermissionsRequest={requestId => {

@ -46,7 +46,7 @@ const mapStateToProps = state => {
const mapDispatchToProps = dispatch => { const mapDispatchToProps = dispatch => {
return { return {
approvePermissionsRequest: (requestId, accounts) => dispatch(approvePermissionsRequest(requestId, accounts)), approvePermissionsRequest: (request, accounts) => dispatch(approvePermissionsRequest(request, accounts)),
rejectPermissionsRequest: requestId => dispatch(rejectPermissionsRequest(requestId)), rejectPermissionsRequest: requestId => dispatch(rejectPermissionsRequest(requestId)),
showNewAccountModal: ({ onCreateNewAccount, newAccountNumber }) => { showNewAccountModal: ({ onCreateNewAccount, newAccountNumber }) => {
return dispatch(showModal({ return dispatch(showModal({

@ -2718,19 +2718,19 @@ function setPendingTokens (pendingTokens) {
// Permissions // Permissions
/** /**
* Approves the permission requests with the given IDs. * Approves the permissions request.
* @param {string} requestId - The id of the permissions request. * @param {Object} request - The permissions request to approve
* @param {string[]} accounts - The accounts to expose, if any. * @param {string[]} accounts - The accounts to expose, if any.
*/ */
function approvePermissionsRequest (requestId, accounts) { function approvePermissionsRequest (request, accounts) {
return () => { return () => {
background.approvePermissionsRequest(requestId, accounts) background.approvePermissionsRequest(request, accounts)
} }
} }
/** /**
* Rejects the permission requests with the given IDs. * Rejects the permissions request with the given ID.
* @param {Array} requestId * @param {string} requestId - The id of the request to be rejected
*/ */
function rejectPermissionsRequest (requestId) { function rejectPermissionsRequest (requestId) {
return () => { return () => {

Loading…
Cancel
Save