Merge pull request #285 from colkito/bug/clean-error-message-not-found

Hide error message when a tx, addr or block is not found
This commit is contained in:
Matias Alejo Garcia 2014-02-13 11:59:58 -02:00
commit 5c8bdd8c0c
6 changed files with 6 additions and 6 deletions

View File

@ -12,6 +12,7 @@ function($scope, $rootScope, $routeParams, $location, Global, Address, getSocket
}, },
function(address) { function(address) {
$rootScope.titleDetail = address.addrStr.substring(0,7) + '...'; $rootScope.titleDetail = address.addrStr.substring(0,7) + '...';
$rootScope.flashMessage = null;
$scope.address = address; $scope.address = address;
}, },
function(e) { function(e) {

View File

@ -68,6 +68,7 @@ angular.module('insight.blocks').controller('BlocksController',
blockHash: $routeParams.blockHash blockHash: $routeParams.blockHash
}, function(block) { }, function(block) {
$rootScope.titleDetail = block.height; $rootScope.titleDetail = block.height;
$rootScope.flashMessage = null;
$scope.loading = false; $scope.loading = false;
$scope.block = block; $scope.block = block;
}, function(e) { }, function(e) {

View File

@ -4,7 +4,7 @@ var TRANSACTION_DISPLAYED = 10;
var BLOCKS_DISPLAYED = 5; var BLOCKS_DISPLAYED = 5;
angular.module('insight.system').controller('IndexController', angular.module('insight.system').controller('IndexController',
function($scope, $rootScope, Global, getSocket, Blocks) { function($scope, Global, getSocket, Blocks) {
$scope.global = Global; $scope.global = Global;
var _getBlocks = function() { var _getBlocks = function() {
@ -19,9 +19,6 @@ angular.module('insight.system').controller('IndexController',
var socket = getSocket($scope); var socket = getSocket($scope);
socket.emit('subscribe', 'inv'); socket.emit('subscribe', 'inv');
//show errors
$scope.flashMessage = $rootScope.flashMessage || null;
socket.on('tx', function(tx) { socket.on('tx', function(tx) {
$scope.txs.unshift(tx); $scope.txs.unshift(tx);
if (parseInt($scope.txs.length, 10) >= parseInt(TRANSACTION_DISPLAYED, 10)) { if (parseInt($scope.txs.length, 10) >= parseInt(TRANSACTION_DISPLAYED, 10)) {

View File

@ -112,6 +112,7 @@ function($scope, $rootScope, $routeParams, $location, Global, Transaction, Trans
txId: txid txId: txid
}, function(tx) { }, function(tx) {
$rootScope.titleDetail = tx.txid.substring(0,7) + '...'; $rootScope.titleDetail = tx.txid.substring(0,7) + '...';
$rootScope.flashMessage = null;
$scope.tx = tx; $scope.tx = tx;
_processTX(tx); _processTX(tx);
$scope.txs.unshift(tx); $scope.txs.unshift(tx);

View File

@ -9,7 +9,7 @@
</div> </div>
<div class="m10v"> <div class="m10v">
<button class="pull-right btn-copy" clip-copy="block.hash"></button> <button class="pull-right btn-copy" clip-copy="block.hash"></button>
<a class="ellipsis" href="/address/{{block.hash}}">{{block.hash}}</a> <a class="ellipsis" href="/block/{{block.hash}}">{{block.hash}}</a>
</div> </div>
<div class="m20v" data-ng-show="!tx.isCoinBase"> <div class="m20v" data-ng-show="!tx.isCoinBase">
<h4>Hashes</h4> <h4>Hashes</h4>

View File

@ -1,5 +1,5 @@
<div class="alert alert-danger" data-ng-show="flashMessage"> <div class="alert alert-danger" data-ng-show="flashMessage">
{{flashMessage}} {{$root.flashMessage}}
</div> </div>
<div data-ng-include src="'/views/includes/connection.html'"></div> <div data-ng-include src="'/views/includes/connection.html'"></div>
<section data-ng-controller="IndexController" data-ng-init="index()"> <section data-ng-controller="IndexController" data-ng-init="index()">