Skip to content
This repository has been archived by the owner on Mar 4, 2023. It is now read-only.

Commit

Permalink
onLoadEnd event hook
Browse files Browse the repository at this point in the history
  • Loading branch information
nicksmetBagaar authored Mar 7, 2018
1 parent 591b617 commit 27da1ee
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { PropTypes } from 'prop-types';

class PlaidAuthenticator extends Component {
render() {
const {publicKey, selectAccount, env, product, clientName, webhook, style, token} = this.props;
const {publicKey, selectAccount, env, product, clientName, webhook, style, token, onLoadEnd} = this.props;

let uri = `https://cdn.plaid.com/link/v2/stable/link.html?key=${publicKey}&apiVersion=v2&env=${env}&product=${product}&clientName=${clientName}&isWebView=true&isMobile=true&webhook=${webhook}&selectAccount=${selectAccount}`
uri = token !== undefined ? `${uri}&token=${token}` : uri
Expand Down Expand Up @@ -32,6 +32,7 @@ class PlaidAuthenticator extends Component {
source={{uri}}
onMessage={(e) => this.onMessage(e)}
injectedJavaScript={patchPostMessageJsCode}
onLoadEnd={onLoadEnd ? onLoadEnd : () => {}}
/>
}

Expand Down Expand Up @@ -63,6 +64,7 @@ class PlaidAuthenticator extends Component {
PlaidAuthenticator.defaultProps = {
publicKey: PropTypes.string.isRequired,
onMessage: PropTypes.func.isRequired,
onLoadEnd: PropTypes.func,
env: PropTypes.string.isRequired,
product: PropTypes.string.isRequired,
clientName: PropTypes.string,
Expand Down

0 comments on commit 27da1ee

Please sign in to comment.