Skip to content
Snippets Groups Projects
Commit 03ea7c9d authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Fix misspelling ($timeout), and showPopupUid promise return

[fix] ES network: do not open help tips
parent de310055
No related branches found
No related tags found
No related merge requests found
Subproject commit 8995b1918fb5cb60b86e6ba53073d5fddb4d36c2 Subproject commit 197e3a8e9162548461251a20ba3b99e1fc89c314
...@@ -188,6 +188,7 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state, ...@@ -188,6 +188,7 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state,
if (!uid) { // user cancel if (!uid) { // user cancel
delete $scope.formData.uid; delete $scope.formData.uid;
UIUtils.loading.hide(); UIUtils.loading.hide();
reject('CANCELLED');
return; return;
} }
resolve(uid); resolve(uid);
...@@ -202,6 +203,8 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state, ...@@ -202,6 +203,8 @@ function WalletController($scope, $rootScope, $q, $ionicPopup, $timeout, $state,
return $scope.showUidPopup() return $scope.showUidPopup()
.then(function(uid) { .then(function(uid) {
if (!uid) return;
UIUtils.loading.show(); UIUtils.loading.show();
return wallet.self(uid) return wallet.self(uid)
......
...@@ -64,7 +64,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. ...@@ -64,7 +64,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
PROTOCOL_VERSION: 10, PROTOCOL_VERSION: 10,
ROOT_BLOCK_HASH: 'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855', ROOT_BLOCK_HASH: 'E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855',
LIMIT_REQUEST_COUNT: 5, // simultaneous async request to a Duniter node LIMIT_REQUEST_COUNT: 5, // simultaneous async request to a Duniter node
LIMIT_REQUEST_DELAY: 1000, // time (in second) to wait between to call of a rest request LIMIT_REQUEST_DELAY: 1000, // time (in ms) to wait between to call of a rest request
regexp: regexp, regexp: regexp,
api: api api: api
}, },
...@@ -175,7 +175,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium. ...@@ -175,7 +175,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
return request(params) return request(params)
.catch(function(err){ .catch(function(err){
// If node return too many requests error // If node return too many requests error
if (err && err.ucode == exports.errorCodes.HTTP_LIMITATION) { if (err && err.ucode === exports.errorCodes.HTTP_LIMITATION) {
// If max number of retry not reach // If max number of retry not reach
if (execCount <= exports.constants.LIMIT_REQUEST_COUNT) { if (execCount <= exports.constants.LIMIT_REQUEST_COUNT) {
if (execCount === 1) { if (execCount === 1) {
......
...@@ -104,7 +104,7 @@ angular.module('cesium.crypto.services', ['cesium.utils.services']) ...@@ -104,7 +104,7 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
CryptoAbstractService.prototype.async_load_base64 = function(on_ready) { CryptoAbstractService.prototype.async_load_base64 = function(on_ready) {
var that = this; var that = this;
if (Base64 !== null) {on_ready(Base64);} if (Base64 !== null) {on_ready(Base64);}
else {$timetout(function(){that.async_load_base64(on_ready);}, 100);} else {$timeout(function(){that.async_load_base64(on_ready);}, 100);}
}; };
CryptoAbstractService.prototype.async_load_sha256 = function(on_ready) { CryptoAbstractService.prototype.async_load_sha256 = function(on_ready) {
...@@ -220,9 +220,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services']) ...@@ -220,9 +220,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
return $q(function (resolve, reject) { return $q(function (resolve, reject) {
try { try {
// TODO: waiting for a new version of js-nacl, with missing functions expose // TODO: waiting for a new version of js-nacl, with missing functions expose
//resolve(that.nacl.crypto_box_keypair_from_sign_sk(signPk); //resolve(that.nacl.crypto_box_keypair_from_sign_sk(signKeyPair.signSk);
resolve(crypto_box_keypair_from_sign_sk(signPk)); resolve(crypto_box_keypair_from_sign_sk(signKeyPair.signSk));
} }
catch(err) { catch(err) {
reject(err); reject(err);
......
...@@ -186,14 +186,10 @@ function ESNetworkLookupController($scope, $state, $location, $ionicPopover, $w ...@@ -186,14 +186,10 @@ function ESNetworkLookupController($scope, $state, $location, $ionicPopover, $w
} }
})); }));
} }
// Show help tip
$scope.showHelpTip();
}; };
$scope.updateView = function(data) { $scope.updateView = function(data) {
console.debug("[peers] Updating UI"); console.debug("[peers] Updating UI");
$scope.$broadcast('$$rebind::' + 'rebind'); // force data binding
$scope.search.results = data.peers; $scope.search.results = data.peers;
$scope.search.memberPeersCount = data.memberPeersCount; $scope.search.memberPeersCount = data.memberPeersCount;
// Always tru if network not started (e.g. after leave+renter the view) // Always tru if network not started (e.g. after leave+renter the view)
...@@ -352,28 +348,6 @@ function ESNetworkLookupController($scope, $state, $location, $ionicPopover, $w ...@@ -352,28 +348,6 @@ function ESNetworkLookupController($scope, $state, $location, $ionicPopover, $w
/* -- help tip -- */
// Show help tip
$scope.showHelpTip = function(index, isTour) {
index = angular.isDefined(index) ? index : csSettings.data.helptip.network;
isTour = angular.isDefined(isTour) ? isTour : false;
if (index < 0) return;
// Create a new scope for the tour controller
var helptipScope = $scope.createHelptipScope();
if (!helptipScope) return; // could be undefined, if a global tour already is already started
helptipScope.tour = isTour;
return helptipScope.startNetworkTour(index, false)
.then(function(endIndex) {
helptipScope.$destroy();
if (!isTour) {
csSettings.data.helptip.network = endIndex;
csSettings.store();
}
});
};
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment