Hide error message when a tx, addr or block is not found

This commit is contained in:
Mario Colque 2014-02-13 10:57:37 -03:00
parent 96c58157ba
commit 6d222d2fca
5 changed files with 5 additions and 5 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

@ -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()">