From bfcbf5f6a559be004bf2e646c94b4871bdaffe35 Mon Sep 17 00:00:00 2001 From: plondon Date: Wed, 10 Jan 2018 17:50:16 -0500 Subject: [PATCH] fix(SFOX): ability to upload docs if active account but level pending --- assets/js/controllers/sfox/sfoxLink.controller.js | 1 + assets/js/controllers/sfox/sfoxUpload.controller.js | 2 +- assets/js/services/sfox.service.js | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/assets/js/controllers/sfox/sfoxLink.controller.js b/assets/js/controllers/sfox/sfoxLink.controller.js index 1f74887def..728c8b407a 100644 --- a/assets/js/controllers/sfox/sfoxLink.controller.js +++ b/assets/js/controllers/sfox/sfoxLink.controller.js @@ -5,6 +5,7 @@ angular function SfoxLinkController ($scope, AngularHelper, $q, $sce, $timeout, sfox, modals, Env, $window) { let exchange = $scope.vm.exchange; let accounts = $scope.vm.accounts; + if (sfox.activeAccount) $scope.vm.close(true); Env.then(env => { $scope.plaidUrl = $sce.trustAsResourceUrl(`${env.walletHelperDomain}/wallet-helper/plaid/#/key/${env.partners.sfox.plaid}/env/${ env.partners.sfox.plaidEnv}`); diff --git a/assets/js/controllers/sfox/sfoxUpload.controller.js b/assets/js/controllers/sfox/sfoxUpload.controller.js index 0ff6096f80..432730b273 100644 --- a/assets/js/controllers/sfox/sfoxUpload.controller.js +++ b/assets/js/controllers/sfox/sfoxUpload.controller.js @@ -59,7 +59,7 @@ function SfoxUploadController (AngularHelper, Env, $scope, $q, state, $http, sfo if (level === 'pending' && !required_docs[0]) complete = true; $scope.onUploadStep = initialUploadStep += 1; - complete && $scope.vm.goTo('link'); + complete && $scope.vm.goTo(sfox.determineStep(exchange)); }; AngularHelper.installLock.call($scope); diff --git a/assets/js/services/sfox.service.js b/assets/js/services/sfox.service.js index 8efe0ec712..b84d7f3119 100644 --- a/assets/js/services/sfox.service.js +++ b/assets/js/services/sfox.service.js @@ -105,7 +105,7 @@ function sfox ($q, MyWallet, Alerts, modals, Env, Exchange, currency, localStora return canTrade && isSFOXCountryState && MyWallet.wallet.hdwallet.defaultAccount.balance > 0; } - function determineStep (exchange, accounts) { + function determineStep (exchange) { let profile = exchange.profile; if (!profile) { return 'create'; @@ -125,7 +125,7 @@ function sfox ($q, MyWallet, Alerts, modals, Env, Exchange, currency, localStora reason: service.sellReason, isDisabled: !service.userCanSell, launchOptions: service.sellLaunchOptions, - verificationRequired: !service.activeAccount + verificationRequired: !service.verified || !service.activeAccount }; }