From 1a6feef57deee9c819ae4b883aa56d6d28589547 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20Baz=C3=A1n?= Date: Tue, 21 Jun 2016 14:51:33 -0300 Subject: [PATCH] internal notification should use default wallet color --- src/js/services/notificationsService.js | 42 ++++++++++++++++--------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/js/services/notificationsService.js b/src/js/services/notificationsService.js index fdc8f18f8..d71bea4ee 100644 --- a/src/js/services/notificationsService.js +++ b/src/js/services/notificationsService.js @@ -30,16 +30,16 @@ angular.module('copayApp.services') if (!last) return false; // rules... - if (last.type === 'NewTxProposal' - && notificationData.type === 'TxProposalAcceptedBy') + if (last.type === 'NewTxProposal' && + notificationData.type === 'TxProposalAcceptedBy') return true; - if (last.type === 'TxProposalFinallyAccepted' - && notificationData.type === 'NewOutgoingTx') + if (last.type === 'TxProposalFinallyAccepted' && + notificationData.type === 'NewOutgoingTx') return true; - if (last.type === 'TxProposalRejectedBy' - && notificationData.type === 'TxProposalFinallyRejected') + if (last.type === 'TxProposalRejectedBy' && + notificationData.type === 'TxProposalFinallyRejected') return true; return false; @@ -55,37 +55,51 @@ angular.module('copayApp.services') var config = configService.getSync(); config.colorFor = config.colorFor || {}; - var color = config.colorFor[walletId] || '#7A8C9E'; + var color = config.colorFor[walletId] || '#4A90E2'; var name = config.aliasFor[walletId] || walletName; switch (notificationData.type) { case 'NewTxProposal': notification.new(gettext('New Payment Proposal'), - name, {color: color} ); + name, { + color: color + }); break; case 'TxProposalAcceptedBy': notification.success(gettext('Payment Proposal Signed by Copayer'), - name, {color: color} ); + name, { + color: color + }); break; case 'TxProposalRejectedBy': notification.error(gettext('Payment Proposal Rejected by Copayer'), - name, {color: color} ); + name, { + color: color + }); break; case 'TxProposalFinallyRejected': notification.error(gettext('Payment Proposal Rejected'), - name, {color: color} ); + name, { + color: color + }); break; case 'NewOutgoingTx': notification.sent(gettext('Payment Sent'), - name, {color: color} ); + name, { + color: color + }); break; case 'NewIncomingTx': notification.funds(gettext('Funds received'), - name, {color: color} ); + name, { + color: color + }); break; case 'ScanFinished': notification.success(gettext('Scan Finished'), - name, {color: color} ); + name, { + color: color + }); break; case 'NewCopayer':