Redux changes and refactoring
This commit is contained in:
@@ -1,3 +1,26 @@
|
||||
import * as Constants from '../../constants';
|
||||
import {createAction} from 'redux-starter-kit';
|
||||
|
||||
export const setApplicationReady = createAction('common/setApplicationReady');
|
||||
let ipcRenderer;
|
||||
if (!process.versions.hasOwnProperty('electron')) {
|
||||
ipcRenderer = ((window && window.require) ? window.require('electron').ipcRenderer : null);
|
||||
}
|
||||
|
||||
export const setApplicationReady = createAction('common/setApplicationReady');
|
||||
|
||||
export const showWindow = () => {
|
||||
return dispatch => {
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.send(Constants.IPC_Show_Window);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const shutdownApplication = () => {
|
||||
return dispatch => {
|
||||
dispatch(setApplicationReady(false));
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.send(Constants.IPC_Shutdown);
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user