Refactoring
This commit is contained in:
@@ -21,4 +21,26 @@ export const shutdownApplication = () => {
|
||||
ipcRenderer.send(Constants.IPC_Shutdown);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const saveState = () => {
|
||||
return (dispatch, getState) => {
|
||||
const state = getState();
|
||||
if (state.common.AppReady) {
|
||||
let currentState = {
|
||||
Release: state.relver.Release,
|
||||
Version: state.relver.Version,
|
||||
};
|
||||
|
||||
for (const provider of Constants.PROVIDER_LIST) {
|
||||
currentState[provider] = currentState.mounts.ProviderState[provider];
|
||||
}
|
||||
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.send(Constants.IPC_Save_State, {
|
||||
State: currentState
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user