Skip to content

Commit

Permalink
push notification suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
escottalexander committed Apr 4, 2024
1 parent 7577ccf commit 3aa21f4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const Constants = {
xrp: ['livenet', 'testnet', 'regtest']
} as { [chain: string]: Array<string> },

// These aliases are here to support legacy clients so don't change them lightly
NETWORK_ALIASES: {
btc: {
mainnet: 'livenet',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const PUSHNOTIFICATIONS_TYPES = {
filename: ['new_outgoing_tx', 'new_zero_outgoing_tx']
},
NewIncomingTx: {
filename: ['new_incoming_tx_testnet', 'new_incoming_tx']
filename: ['new_incoming_tx']
},
TxProposalFinallyRejected: {
filename: 'txp_finally_rejected'
Expand Down Expand Up @@ -167,7 +167,12 @@ export class PushNotificationsService {
if (!notifType) return cb();

if (notification.type === 'NewIncomingTx') {
notifType.filename = Utils.getGenericName(notification.data.network) === 'testnet' ? notifType.filename[0] : notifType.filename[1];
notifType.filename = notifType.filename[0];
if (notification.data.network && notification.data.network !== 'mainnet') {
notification.data.networkStr = ' on ' + notification.data.network;
} else {
notification.data.networkStr = '';
}
} else if (notification.type === 'NewOutgoingTx') {
// Handle zero amount ETH transactions to contract addresses
notifType.filename = notification.data.amount !== 0 ? notifType.filename[0] : notifType.filename[1];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
{{subjectPrefix}}New payment received
You have received a payment of {{amount}}. The transaction is still unconfirmed.
You have received a payment of {{amount}}{{networkStr}}. The transaction is still unconfirmed.

This file was deleted.

0 comments on commit 3aa21f4

Please sign in to comment.