Skip to content
This repository has been archived by the owner on Oct 8, 2019. It is now read-only.

Commit

Permalink
fix(Plaid): replace with placeholder when plaid is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Dec 19, 2017
1 parent 71f26b2 commit 145de3e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/partials/sfox/link.pug
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
scrolling = 'no'
id='plaid'
)
button.btn.button-primary.full(ng-if="state.plaid.enabled" ng-disabled="state.plaid.enabled") Sign In To Your Bank Account
.mvvl(ng-if="!inMobileBuy")
span.or-horizontal.flex-justify(translate="OR")
button.btn.button-primary-inverse.full(translate="Manually Enter Account & Routing Numbers" ng-hide="state.enableBankAccountForm" ng-click="state.enableBankAccountForm = true")
Expand Down
3 changes: 3 additions & 0 deletions helperApp/plaid/plaid.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,18 @@ function PlaidController ($scope, $routeParams) {
key: $routeParams.apiKey,
onLoad: function () {},
onExit: function () {
$scope.hideButton = false; $scope.$root.$apply();
window.parent.postMessage({from: 'plaid', to: 'exchange', command: 'disablePlaid'}, parentUrl);
},
onSuccess: function (public_token, metadata) {
$scope.hideButton = false; $scope.$root.$apply();
window.parent.postMessage({from: 'plaid', to: 'exchange', command: 'getBankAccounts', msg: public_token}, parentUrl);
}
});

$scope.enablePlaid = () => {
window.parent.postMessage({from: 'plaid', to: 'exchange', command: 'enablePlaid'}, parentUrl);
$scope.hideButton = true;
linkHandler.open();
};
}
Expand Down
4 changes: 4 additions & 0 deletions helperApp/plaid/plaid.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,7 @@
body {
margin: 0px;
}

.ng-hide {
display: none;
}
2 changes: 1 addition & 1 deletion helperApp/plaid/routes.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function RoutesConfig ($routeProvider) {
})
.when('/key/:apiKey/env/:env', {
controller: 'PlaidController',
template: '<button ng-click="enablePlaid()" class="btn button-primary full">Sign In To Your Bank Account</button>'
template: '<button ng-if="!hideButton" ng-click="enablePlaid()" class="btn button-primary full">Sign In To Your Bank Account</button>'
})
.otherwise({
redirectTo: '/'
Expand Down

0 comments on commit 145de3e

Please sign in to comment.