fix uxrefresh with new #setup
This commit is contained in:
parent
df23125f5e
commit
a8d85adc84
8 changed files with 46 additions and 46 deletions
25
js/services/controllerUtils.js
Normal file
25
js/services/controllerUtils.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
'use strict';
|
||||
|
||||
angular.module('copay.controllerUtils').factory('controllerUtils', function ($rootScope, $location) {
|
||||
var root = {};
|
||||
root.setupUxHandlers = function(w) {
|
||||
w.on('created', function() {
|
||||
$location.path('peer');
|
||||
$rootScope.wallet = w;
|
||||
$rootScope.$digest();
|
||||
});
|
||||
w.on('refresh', function() {
|
||||
console.log('[controllerUtils.js] RECEIVED REFRESH'); //TODO
|
||||
$rootScope.$digest();
|
||||
});
|
||||
|
||||
w.on('openError', function(){
|
||||
$scope.loading = false;
|
||||
$rootScope.flashMessage = {type:'error', message: 'Wallet not found'};
|
||||
$location.path('signin');
|
||||
});
|
||||
};
|
||||
|
||||
return root;
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue