From 8ef2080a12534f481b2af0e1ed0c216e962ece5a Mon Sep 17 00:00:00 2001 From: blavenie <benoit.lavenier@e-is.pro> Date: Sat, 11 Feb 2017 17:48:18 +0100 Subject: [PATCH] - Error if uid not correct - fix #277 - Wallet: fix popover actions --- www/js/controllers/settings-controllers.js | 2 +- www/js/controllers/wallet-controllers.js | 13 +------------ www/js/services/wallet-services.js | 2 +- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/www/js/controllers/settings-controllers.js b/www/js/controllers/settings-controllers.js index ae54eec88..38178382d 100644 --- a/www/js/controllers/settings-controllers.js +++ b/www/js/controllers/settings-controllers.js @@ -201,7 +201,7 @@ function SettingsController($scope, $q, $ionicPopup, $timeout, $translate, csHtt $scope.showActionsPopover = function(event) { if (!$scope.actionsPopover) { - $ionicPopover.fromTemplateUrl('templates/settings/lookup_popover_actions.html', { + $ionicPopover.fromTemplateUrl('templates/settings/popover_actions.html', { scope: $scope }).then(function(popover) { $scope.actionsPopover = popover; diff --git a/www/js/controllers/wallet-controllers.js b/www/js/controllers/wallet-controllers.js index b6716baff..dc96852a1 100644 --- a/www/js/controllers/wallet-controllers.js +++ b/www/js/controllers/wallet-controllers.js @@ -60,17 +60,6 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state, }); }); - $ionicPopover.fromTemplateUrl('templates/wallet/lookup_popover_actions.html', { - scope: $scope - }).then(function(popover) { - $scope.actionsPopover = popover; - }); - - //Cleanup the popover when we're done with it! - $scope.$on('$destroy', function() { - $scope.actionsPopover.remove(); - }); - $scope.onSettingsChanged = function() { if (!$scope.walletData || $scope.loading) return; $scope.unit = $filter('currencySymbol')($scope.walletData.currency, csSettings.data.useRelative); @@ -532,7 +521,7 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state, $scope.showActionsPopover = function(event) { if (!$scope.actionsPopover) { - $ionicPopover.fromTemplateUrl('templates/wallet/lookup_popover_actions.html', { + $ionicPopover.fromTemplateUrl('templates/wallet/popover_actions.html', { scope: $scope }).then(function(popover) { $scope.actionsPopover = popover; diff --git a/www/js/services/wallet-services.js b/www/js/services/wallet-services.js index d598e60f1..19c96fe4b 100644 --- a/www/js/services/wallet-services.js +++ b/www/js/services/wallet-services.js @@ -1258,7 +1258,7 @@ angular.module('cesium.wallet.services', ['ngResource', 'ngApi', 'cesium.bma.ser */ self = function(uid, needToLoadRequirements) { if (!BMA.regex.USER_ID.test(uid)){ - throw new Error('ERROR.INVALID_USER_ID'); + return $q.reject({message: 'ERROR.INVALID_USER_ID'}); } var block; return $q.all([ -- GitLab