diff --git a/src/store/middlewares/account.js b/src/store/middlewares/account.js index 403cc650d4..53671fa6a4 100644 --- a/src/store/middlewares/account.js +++ b/src/store/middlewares/account.js @@ -53,13 +53,15 @@ const filterIncomingTransactions = (transactions, account) => transactions.filte const showNotificationsForIncomingTransactions = (transactions, account, token) => { filterIncomingTransactions(transactions, account).forEach((transaction) => { const amount = fromRawLsk(transaction.asset.amount); - const message = transaction.asset.data - ? i18n.t('with message {{message}}', { message: transaction.asset.data }) - : ''; - // eslint-disable-next-line no-new - new Notification(i18n.t('{{amount}} {{token}} Received', { amount, token }), { - body: i18n.t('Your account just received {{amount}} {{token}} {{message}}', { amount, token, message }), - }); + if (amount > 0) { + const message = transaction.asset.data + ? i18n.t('with message {{message}}', { message: transaction.asset.data }) + : ''; + // eslint-disable-next-line no-new + new Notification(i18n.t('{{amount}} {{token}} Received', { amount, token }), { + body: i18n.t('Your account just received {{amount}} {{token}} {{message}}', { amount, token, message }), + }); + } }); }; diff --git a/src/utils/notification.js b/src/utils/notification.js index b9a5c21307..aaeffc996e 100644 --- a/src/utils/notification.js +++ b/src/utils/notification.js @@ -53,8 +53,10 @@ export class Notify { * @memberof Notify */ _deposit(amount) { // eslint-disable-line - const body = i18next.t('You\'ve received {{value}} LSK.', { value: fromRawLsk(amount) }); - new window.Notification(i18next.t('LSK received'), { body }); // eslint-disable-line + if (amount > 0) { + const body = i18next.t('You\'ve received {{value}} LSK.', { value: fromRawLsk(amount) }); + new window.Notification(i18next.t('LSK received'), { body }); // eslint-disable-line + } } }