mirror of https://github.com/BTCPrivate/copay.git
Merge pull request #442 from yemel/fix/rename-flashmessage
Rename flashMessage variable
This commit is contained in:
commit
3a2cb6ff56
|
@ -67,10 +67,10 @@
|
|||
|
||||
</div>
|
||||
|
||||
<div class="row" ng-if='$root.flashMessage.message' notification>
|
||||
<div class="row" ng-if='$root.$flashMessage.message' notification>
|
||||
<div class="small-8 large-centered columns">
|
||||
<div data-alert class="alert-box radius {{$root.flashMessage.type}}">
|
||||
{{$root.flashMessage.message}}
|
||||
<div data-alert class="alert-box radius {{$root.$flashMessage.type}}">
|
||||
{{$root.$flashMessage.message}}
|
||||
<a ng-click="clearFlashMessage()" class="close">×</a>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -50,7 +50,7 @@ angular.module('copay.header').controller('HeaderController',
|
|||
};
|
||||
|
||||
$scope.clearFlashMessage = function() {
|
||||
$rootScope.flashMessage = {};
|
||||
$rootScope.$flashMessage = {};
|
||||
};
|
||||
|
||||
$rootScope.isCollapsed = true;
|
||||
|
|
|
@ -23,7 +23,7 @@ angular.module('copay.import').controller('ImportController',
|
|||
|
||||
$scope.import = function(form) {
|
||||
if (form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'There is an error in the form. Please, try again', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'There is an error in the form. Please, try again', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ angular.module('copay.import').controller('ImportController',
|
|||
var password = form.password.$modelValue;
|
||||
|
||||
if (!backupFile && !backupText) {
|
||||
$rootScope.flashMessage = { message: 'Please, select your backup file or paste the text', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Please, select your backup file or paste the text', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ angular.module('copay.send').controller('SendController',
|
|||
|
||||
$scope.submitForm = function(form) {
|
||||
if (form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'You can not send a proposal transaction. Please, try again', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'You can not send a proposal transaction. Please, try again', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ angular.module('copay.send').controller('SendController',
|
|||
w.createTx( address, amount,function() {
|
||||
|
||||
$scope.loading = false;
|
||||
$rootScope.flashMessage = { message: 'The transaction proposal has been created', type: 'success'};
|
||||
$rootScope.$flashMessage = { message: 'The transaction proposal has been created', type: 'success'};
|
||||
$rootScope.$digest();
|
||||
});
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ angular.module('copay.setup').controller('SetupController',
|
|||
|
||||
$scope.create = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
$scope.loading = true;
|
||||
|
|
|
@ -14,7 +14,7 @@ angular.module('copay.signin').controller('SigninController',
|
|||
|
||||
$scope.create = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ angular.module('copay.signin').controller('SigninController',
|
|||
|
||||
$scope.open = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,7 @@ angular.module('copay.signin').controller('SigninController',
|
|||
var w = walletFactory.open($scope.selectedWalletId, { passphrase: passphrase});
|
||||
if (!w) {
|
||||
$scope.loading = $scope.failure = false;
|
||||
$rootScope.flashMessage = { message: 'Bad password or connection error', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Bad password or connection error', type: 'error'};
|
||||
$rootScope.$digest();
|
||||
return;
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ angular.module('copay.signin').controller('SigninController',
|
|||
|
||||
$scope.join = function(form) {
|
||||
if (form && form.$invalid) {
|
||||
$rootScope.flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Please, enter required fields', type: 'error'};
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -66,13 +66,13 @@ angular.module('copay.signin').controller('SigninController',
|
|||
$scope.loading = false;
|
||||
if (err || !w) {
|
||||
if (err === 'joinError')
|
||||
$rootScope.flashMessage = { message: 'Can not find peer'};
|
||||
$rootScope.$flashMessage = { message: 'Can not find peer'};
|
||||
else if (err === 'walletFull')
|
||||
$rootScope.flashMessage = { message: 'The wallet is full'};
|
||||
$rootScope.$flashMessage = { message: 'The wallet is full', type: 'error'};
|
||||
else if (err === 'badSecret')
|
||||
$rootScope.flashMessage = { message: 'Bad secret secret string', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Bad secret secret string', type: 'error'};
|
||||
else
|
||||
$rootScope.flashMessage = { message: 'Unknown error', type: 'error'};
|
||||
$rootScope.$flashMessage = { message: 'Unknown error', type: 'error'};
|
||||
controllerUtils.onErrorDigest();
|
||||
} else {
|
||||
controllerUtils.startNetwork(w);
|
||||
|
|
|
@ -47,7 +47,7 @@ angular.module('copay.transactions').controller('TransactionsController',
|
|||
var w = $rootScope.wallet;
|
||||
w.sendTx(ntxid, function(txid) {
|
||||
console.log('[transactions.js.68:txid:] SENTTX CALLBACK',txid); //TODO
|
||||
$rootScope.flashMessage = txid
|
||||
$rootScope.$flashMessage = txid
|
||||
? {type:'success', message: 'Transaction broadcasted. txid: ' + txid}
|
||||
: {type:'error', message: 'There was an error sending the Transaction'}
|
||||
;
|
||||
|
@ -61,7 +61,7 @@ angular.module('copay.transactions').controller('TransactionsController',
|
|||
var w = $rootScope.wallet;
|
||||
w.sign(ntxid, function(ret){
|
||||
if (!ret) {
|
||||
$rootScope.flashMessage = {
|
||||
$rootScope.$flashMessage = {
|
||||
type:'error',
|
||||
message: 'There was an error signing the Transaction',
|
||||
};
|
||||
|
@ -101,7 +101,7 @@ angular.module('copay.transactions').controller('TransactionsController',
|
|||
$rootScope.txAlertCount = 0;
|
||||
var w = $rootScope.wallet;
|
||||
w.reject(ntxid);
|
||||
$rootScope.flashMessage = {type:'warning', message: 'Transaction rejected by you'};
|
||||
$rootScope.$flashMessage = {type:'warning', message: 'Transaction rejected by you'};
|
||||
$scope.loading = false;
|
||||
};
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ angular.module('copay.directives')
|
|||
link: function(scope, element, attrs, ctrl) {
|
||||
setTimeout(function() {
|
||||
scope.$apply(function() {
|
||||
$rootScope.flashMessage = {};
|
||||
$rootScope.$flashMessage = {};
|
||||
});
|
||||
}, 5000);
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ angular.module('copay.controllerUtils')
|
|||
video.close();
|
||||
// Clear rootScope
|
||||
for (var i in $rootScope) {
|
||||
if (i.charAt(0) != '$' && i != 'flashMessage') {
|
||||
if (i.charAt(0) != '$') {
|
||||
delete $rootScope[i];
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ angular.module('copay.controllerUtils')
|
|||
$rootScope.$digest();
|
||||
};
|
||||
w.on('badMessage', function(peerId) {
|
||||
$rootScope.flashMessage = {
|
||||
$rootScope.$flashMessage = {
|
||||
type: 'error',
|
||||
message: 'Received wrong message from peer id:' + peerId
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue