Skip to content
Permalink
Browse files

Native notifications

  • Loading branch information...
sawlysawly committed Mar 8, 2019
1 parent 3221e5f commit d7b4f5b58fdf3a071e2266e06e0d937b929d7ae4
Showing with 9 additions and 0 deletions.
  1. +1 −0 react/package.json
  2. +6 −0 react/src/reducers/toaster.js
  3. +1 −0 react/webpack.config.js
  4. +1 −0 react/webpack.prod.config.js
@@ -42,6 +42,7 @@
"babel-preset-es2015": "^6.14.0",
"babel-preset-react": "^6.24.1",
"bluebird": "^3.5.0",
"electron-native-notify": "^1.1.5",
"ethers": "git://github.com/pbca26/ethers.js",
"express": "^4.14.0",
"file-loader": "^0.10.0",
@@ -2,6 +2,7 @@ import {
ADD_TOASTER_MESSAGE,
REMOVE_TOASTER_MESSAGE,
} from '../actions/storeType';
import notify from 'electron-native-notify';

const arrayToString = (arr) => {
if (typeof arr === 'object') {
@@ -18,6 +19,11 @@ export const toaster = (state = {

switch (action.type) {
case ADD_TOASTER_MESSAGE:
if(notify.isSupported()) {
notify(action.title, action.message.join ? action.message.join('\n') : action.message);
return state;
}

let _isSameToastTwice = false;

for (let i = 0; i < state.toasts.length; i++) {
@@ -160,6 +160,7 @@ if (isProduction) {
}

module.exports = {
target: 'electron-renderer',
devtool: isProduction ? 'eval' : 'source-map',
context: jsSourcePath,
entry: {
@@ -160,6 +160,7 @@ if (isProduction) {
}

module.exports = {
target: 'electron-renderer',
devtool: isProduction ? 'eval' : 'source-map',
context: jsSourcePath,
entry: {

0 comments on commit d7b4f5b

Please sign in to comment.
You can’t perform that action at this time.