Browse Source

feature(notification): setup basic notification functionality

renovate/lint-staged-8.x
Jack Mallers 7 years ago
parent
commit
2ff16a75c5
  1. 8
      app/notifications/index.js
  2. 3
      app/reducers/transaction.js

8
app/notifications/index.js

@ -0,0 +1,8 @@
export default {
showNotification: (title, body, onClick) => {
new Notification(title, {
body,
onClick
})
}
}

3
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')
}

Loading…
Cancel
Save