@@ -9,9 +9,11 @@ var walletDefinedByKeys = require('byteballcore/wallet_defined_by_keys.js');
99var eventBus = require ( 'byteballcore/event_bus.js' ) ;
1010var objectHash = require ( 'byteballcore/object_hash.js' ) ;
1111var ecdsaSig = require ( 'byteballcore/signature.js' ) ;
12+ var breadcrumbs = require ( 'byteballcore/breadcrumbs.js' ) ;
1213var Bitcore = require ( 'bitcore-lib' ) ;
1314
1415angular . module ( 'copayApp.controllers' ) . controller ( 'indexController' , function ( $rootScope , $scope , $log , $filter , $timeout , lodash , go , profileService , configService , isCordova , storageService , addressService , gettext , gettextCatalog , amMoment , nodeWebkit , addonManager , txFormatService , uxLanguage , $state , isMobile , addressbookService , notification , animationService , $modal , bwcService ) {
16+ breadcrumbs . add ( 'index.js' ) ;
1517 var self = this ;
1618 self . isCordova = isCordova ;
1719 self . isSafari = isMobile . Safari ( ) ;
@@ -58,7 +60,12 @@ angular.module('copayApp.controllers').controller('indexController', function($r
5860 network . findOutboundPeerOrConnect ( bug_sink_url , function ( err , ws ) {
5961 if ( err )
6062 return ;
61- network . sendJustsaying ( ws , 'bugreport' , { message : error_message , exception : error_object . stack || error_object } ) ;
63+ breadcrumbs . add ( 'bugreport' ) ;
64+ var description = error_object . stack || JSON . stringify ( error_object , null , '\t' ) ;
65+ description += "\n\nBreadcrumbs:\n" + breadcrumbs . get ( ) . join ( "\n" ) + "\n\n" ;
66+ description += "UA: " + navigator . userAgent + "\n" ;
67+ description += "Program: " + conf . program + ' ' + conf . program_version + "\n" ;
68+ network . sendJustsaying ( ws , 'bugreport' , { message : error_message , exception : description } ) ;
6269 } ) ;
6370 }
6471
@@ -851,7 +858,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
851858 self . updateLocalTxHistory = function ( client , cb ) {
852859 var walletId = client . credentials . walletId ;
853860
854- client . getTxHistory ( self . arrBalances [ self . assetIndex ] . asset , function ( txs ) {
861+ client . getTxHistory ( self . arrBalances [ self . assetIndex ] . asset , function onGotTxHistory ( txs ) {
855862 var newHistory = self . processNewTxs ( txs ) ;
856863 $log . debug ( 'Tx History synced. Total Txs: ' + newHistory . length ) ;
857864
@@ -888,7 +895,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
888895 self . txHistoryError = false ;
889896 self . updatingTxHistory [ walletId ] = true ;
890897
891- $timeout ( function ( ) {
898+ $timeout ( function onUpdateHistoryTimeout ( ) {
892899 self . updateLocalTxHistory ( fc , function ( err ) {
893900 self . updatingTxHistory [ walletId ] = false ;
894901 if ( err )
0 commit comments