From cf3917ce8d41f2d5d5caebd05d3627e8411532f0 Mon Sep 17 00:00:00 2001 From: beregovoy68 Date: Thu, 1 Dec 2016 19:32:57 +0300 Subject: [PATCH 1/2] Removed internet connection check on loading --- src/index.html | 2 +- src/js/splash.controller.js | 12 +++--------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/src/index.html b/src/index.html index 730d732ba3..e7f6b8612f 100644 --- a/src/index.html +++ b/src/index.html @@ -39,7 +39,7 @@
-

{{::splash.connectionFailed}}

+

Loading

diff --git a/src/js/splash.controller.js b/src/js/splash.controller.js index e552835809..a63434a22b 100644 --- a/src/js/splash.controller.js +++ b/src/js/splash.controller.js @@ -3,18 +3,12 @@ angular .module('app.ui') - .controller('splashController', ['$scope', 'apiService', 'ui.events', function ($scope, api, events) { + .controller('splashController', ['$scope', '$timeout', 'ui.events', function ($scope, $timeout, events) { NProgress.start(); - var splash = this; - - api.blocks.last().then(function (block) { + $timeout(function () { NProgress.done(); $scope.$emit(events.SPLASH_COMPLETED); - }, - function (response) { - NProgress.done(); - splash.connectionFailed = 'Failed connecting to Waves'; - }); + }, 1); }]); })(); From 3d35f2a9be88a5862722db7acd626795c5171e91 Mon Sep 17 00:00:00 2001 From: beregovoy68 Date: Thu, 1 Dec 2016 21:04:28 +0300 Subject: [PATCH 2/2] Improved the error handling on waves transfer, asset issue/reissue --- src/js/app.js | 1 + src/js/portfolio/asset.reissue.controller.js | 6 ++---- src/js/portfolio/asset.transfer.controller.js | 6 ++---- src/js/tokens/token.create.controller.js | 14 ++++++-------- src/js/wallet/wallet.controller.js | 6 ++---- 5 files changed, 13 insertions(+), 20 deletions(-) diff --git a/src/js/app.js b/src/js/app.js index 882bb68e08..192d8b36f7 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -113,6 +113,7 @@ function AngularApplicationRun(rest, applicationConstants, notificationService, //var url = 'http://52.28.66.217:6869'; //var url = 'http://52.77.111.219:6869'; //var url = 'http://127.0.0.1:6869'; + //var url = 'http://127.0.0.1:8089'; rest.setBaseUrl(url); // override mock methods cos in config phase services are not available yet diff --git a/src/js/portfolio/asset.reissue.controller.js b/src/js/portfolio/asset.reissue.controller.js index 2c6042759e..500f018f40 100644 --- a/src/js/portfolio/asset.reissue.controller.js +++ b/src/js/portfolio/asset.reissue.controller.js @@ -117,15 +117,13 @@ reissue.asset.currency.displayName + '
Date: ' + formattingService.formatTimestamp(transaction.timestamp); notificationService.notice(displayMessage); - //enable confirm button - reissue.confirm.reissuePending = false; - transaction = undefined; }, function (response) { - if (angular.isDefined(response.data)) + if (response.data) notificationService.error('Error:' + response.data.error + ' - ' + response.data.message); else notificationService.error('Request failed. Status: ' + response.status + ' - ' + response.statusText); + }).finally(function () { //enable confirm button reissue.confirm.reissuePending = false; transaction = undefined; diff --git a/src/js/portfolio/asset.transfer.controller.js b/src/js/portfolio/asset.transfer.controller.js index 67d3afc315..5dd966ebb0 100644 --- a/src/js/portfolio/asset.transfer.controller.js +++ b/src/js/portfolio/asset.transfer.controller.js @@ -159,15 +159,13 @@ '
Recipient ' + address.substr(0,15) + '...
Date: ' + formattingService.formatTimestamp(transaction.timestamp); notificationService.notice(displayMessage); - //enable confirm button - transfer.confirm.paymentPending = false; - transaction = undefined; }, function (response) { - if (angular.isDefined(response.data)) + if (response.data) notificationService.error('Error:' + response.data.error + ' - ' + response.data.message); else notificationService.error('Request failed. Status: ' + response.status + ' - ' + response.statusText); + }).finally(function () { //enable confirm button transfer.confirm.paymentPending = false; transaction = undefined; diff --git a/src/js/tokens/token.create.controller.js b/src/js/tokens/token.create.controller.js index d17189913e..b6e34d9d17 100644 --- a/src/js/tokens/token.create.controller.js +++ b/src/js/tokens/token.create.controller.js @@ -128,23 +128,21 @@ // disable confirm button ctrl.confirm.pendingIssuance = true; apiService.assets.issue(transaction).then(function (response) { + resetIssueAssetForm(); + + applicationContext.cache.assets.put(response); + var displayMessage = 'Asset ' + ctrl.confirm.name + ' has been issued!
' + 'Total tokens amount: ' + ctrl.confirm.totalTokens + '
' + 'Date: ' + formattingService.formatTimestamp(transaction.timestamp); notificationService.notice(displayMessage); - - applicationContext.cache.assets.put(response); - - transaction = undefined; - ctrl.confirm.pendingIssuance = false; - resetIssueAssetForm(); }, function (response) { - if (angular.isDefined(response.data)) + if (response.data) notificationService.error('Error:' + response.data.error + ' - ' + response.data.message); else notificationService.error('Request failed. Status: ' + response.status + ' - ' + response.statusText); - + }).finally(function () { transaction = undefined; ctrl.confirm.pendingIssuance = false; }); diff --git a/src/js/wallet/wallet.controller.js b/src/js/wallet/wallet.controller.js index 805bddc1a0..631d6618bc 100644 --- a/src/js/wallet/wallet.controller.js +++ b/src/js/wallet/wallet.controller.js @@ -200,15 +200,13 @@ '
Recipient ' + address.substr(0,15) + '...
Date: ' + formattingService.formatTimestamp(transaction.timestamp); notificationService.notice(displayMessage); - //enable confirm button - wallet.confirm.paymentPending = false; - transaction = undefined; }, function (response) { - if (angular.isDefined(response.data)) + if (response.data) notificationService.error('Error:' + response.data.error + ' - ' + response.data.message); else notificationService.error('Request failed. Status: ' + response.status + ' - ' + response.statusText); + }).finally(function () { //enable confirm button wallet.confirm.paymentPending = false; transaction = undefined;