From da812205ae77f8eb226446df191550081bd9924a Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Wed, 29 Jun 2016 20:50:18 +0200 Subject: [PATCH] fix(Deploy): inject Wallet to fix lazy-load race condition --- assets/js/controllers/authorizeApprove.controller.js | 4 +++- assets/js/controllers/resetTwoFactorToken.controller.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/assets/js/controllers/authorizeApprove.controller.js b/assets/js/controllers/authorizeApprove.controller.js index da8ae83aad..47554bf1c3 100644 --- a/assets/js/controllers/authorizeApprove.controller.js +++ b/assets/js/controllers/authorizeApprove.controller.js @@ -2,7 +2,9 @@ angular .module('walletApp') .controller('AuthorizeApproveCtrl', AuthorizeApproveCtrl); -function AuthorizeApproveCtrl ($window, $scope, WalletTokenEndpoints, $stateParams, $state, Alerts, $translate, $rootScope, MyWalletHelpers) { +// Wallet is injected to ensure it's lazy-load before this controller is +// initialized. Otherwise $rootScope.rootUrl will be incorrect. +function AuthorizeApproveCtrl ($window, $scope, WalletTokenEndpoints, $stateParams, $state, Alerts, $translate, $rootScope, MyWalletHelpers, Wallet) { $scope.success = false; const success = (res) => { diff --git a/assets/js/controllers/resetTwoFactorToken.controller.js b/assets/js/controllers/resetTwoFactorToken.controller.js index 0506358575..c6187cdca7 100644 --- a/assets/js/controllers/resetTwoFactorToken.controller.js +++ b/assets/js/controllers/resetTwoFactorToken.controller.js @@ -2,7 +2,9 @@ angular .module('walletApp') .controller('ResetTwoFactorTokenCtrl', ResetTwoFactorTokenCtrl); -function ResetTwoFactorTokenCtrl ($scope, WalletTokenEndpoints, $stateParams, $state, Alerts, $translate, $rootScope) { +// Wallet is injected to ensure it's lazy-load before this controller is +// initialized. Otherwise $rootScope.rootUrl will be incorrect. +function ResetTwoFactorTokenCtrl ($scope, WalletTokenEndpoints, $stateParams, $state, Alerts, $translate, $rootScope, Wallet) { Alerts.clear(); const success = (obj) => {