Merge pull request #4475 from gabrielbazan7/fix/NotifColor

internal notification should use default wallet color
This commit is contained in:
Gustavo Maximiliano Cortez 2016-06-22 11:37:39 -03:00 committed by GitHub
commit a0ec2ac18a

View file

@ -30,16 +30,16 @@ angular.module('copayApp.services')
if (!last) return false; if (!last) return false;
// rules... // rules...
if (last.type === 'NewTxProposal' if (last.type === 'NewTxProposal' &&
&& notificationData.type === 'TxProposalAcceptedBy') notificationData.type === 'TxProposalAcceptedBy')
return true; return true;
if (last.type === 'TxProposalFinallyAccepted' if (last.type === 'TxProposalFinallyAccepted' &&
&& notificationData.type === 'NewOutgoingTx') notificationData.type === 'NewOutgoingTx')
return true; return true;
if (last.type === 'TxProposalRejectedBy' if (last.type === 'TxProposalRejectedBy' &&
&& notificationData.type === 'TxProposalFinallyRejected') notificationData.type === 'TxProposalFinallyRejected')
return true; return true;
return false; return false;
@ -55,37 +55,51 @@ angular.module('copayApp.services')
var config = configService.getSync(); var config = configService.getSync();
config.colorFor = config.colorFor || {}; config.colorFor = config.colorFor || {};
var color = config.colorFor[walletId] || '#7A8C9E'; var color = config.colorFor[walletId] || '#4A90E2';
var name = config.aliasFor[walletId] || walletName; var name = config.aliasFor[walletId] || walletName;
switch (notificationData.type) { switch (notificationData.type) {
case 'NewTxProposal': case 'NewTxProposal':
notification.new(gettext('New Payment Proposal'), notification.new(gettext('New Payment Proposal'),
name, {color: color} ); name, {
color: color
});
break; break;
case 'TxProposalAcceptedBy': case 'TxProposalAcceptedBy':
notification.success(gettext('Payment Proposal Signed by Copayer'), notification.success(gettext('Payment Proposal Signed by Copayer'),
name, {color: color} ); name, {
color: color
});
break; break;
case 'TxProposalRejectedBy': case 'TxProposalRejectedBy':
notification.error(gettext('Payment Proposal Rejected by Copayer'), notification.error(gettext('Payment Proposal Rejected by Copayer'),
name, {color: color} ); name, {
color: color
});
break; break;
case 'TxProposalFinallyRejected': case 'TxProposalFinallyRejected':
notification.error(gettext('Payment Proposal Rejected'), notification.error(gettext('Payment Proposal Rejected'),
name, {color: color} ); name, {
color: color
});
break; break;
case 'NewOutgoingTx': case 'NewOutgoingTx':
notification.sent(gettext('Payment Sent'), notification.sent(gettext('Payment Sent'),
name, {color: color} ); name, {
color: color
});
break; break;
case 'NewIncomingTx': case 'NewIncomingTx':
notification.funds(gettext('Funds received'), notification.funds(gettext('Funds received'),
name, {color: color} ); name, {
color: color
});
break; break;
case 'ScanFinished': case 'ScanFinished':
notification.success(gettext('Scan Finished'), notification.success(gettext('Scan Finished'),
name, {color: color} ); name, {
color: color
});
break; break;
case 'NewCopayer': case 'NewCopayer':