From 2ff16a75c58edf91d2f75ae836c36d0b54f6f0dd Mon Sep 17 00:00:00 2001 From: Jack Mallers Date: Fri, 22 Sep 2017 20:28:51 -0500 Subject: [PATCH] feature(notification): setup basic notification functionality --- app/notifications/index.js | 8 ++++++++ app/reducers/transaction.js | 3 +++ 2 files changed, 11 insertions(+) create mode 100644 app/notifications/index.js diff --git a/app/notifications/index.js b/app/notifications/index.js new file mode 100644 index 00000000..3e311921 --- /dev/null +++ b/app/notifications/index.js @@ -0,0 +1,8 @@ +export default { + showNotification: (title, body, onClick) => { + new Notification(title, { + body, + onClick + }) + } +} \ No newline at end of file diff --git a/app/reducers/transaction.js b/app/reducers/transaction.js index 1b5e590c..beaa2a5e 100644 --- a/app/reducers/transaction.js +++ b/app/reducers/transaction.js @@ -1,4 +1,5 @@ import { ipcRenderer } from 'electron' +import { showNotification } from '../notifications' import { btc, usd } from '../utils' import { setForm, resetForm } from './form' import { showModal } from './modal' @@ -69,6 +70,8 @@ export const transactionError = () => (dispatch) => { // Listener for when a new transaction is pushed from the subscriber export const newTransaction = (event, { transaction }) => (dispatch) => { dispatch({ type: ADD_TRANSACTION, transaction }) + + showNotification('New transaction!', 'You have a new transaction') }