Fix upgrades
This commit is contained in:
@@ -8,6 +8,10 @@ import {
|
||||
setInstalledVersion,
|
||||
setReleaseUpgradeAvailable
|
||||
} from './release_version_actions';
|
||||
import {
|
||||
setApplicationReady,
|
||||
shutdownApplication
|
||||
} from './common_actions';
|
||||
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
|
||||
@@ -126,16 +130,18 @@ export const installRelease = (source, version, completedCallback) => {
|
||||
export const installUpgrade = (source, sha256, signature, skipVerification, completedCallback) => {
|
||||
return (dispatch, getState) => {
|
||||
if (ipcRenderer && !getState().install.InstallActive) {
|
||||
dispatch(setInstallActive(Constants.INSTALL_TYPES.Dependency));
|
||||
dispatch(setInstallActive(Constants.INSTALL_TYPES.Upgrade));
|
||||
dispatch(setApplicationReady(false));
|
||||
|
||||
const installUpgradeComplete = (event, arg) => {
|
||||
ipcRenderer.removeListener(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
|
||||
ipcRenderer.send(Constants.IPC_Delete_File, {
|
||||
FilePath: source,
|
||||
});
|
||||
|
||||
dispatch(setInstallComplete(arg.data));
|
||||
completedCallback(source, arg.data);
|
||||
if (arg.data.Success) {
|
||||
dispatch(shutdownApplication());
|
||||
} else {
|
||||
dispatch(setApplicationReady(true));
|
||||
dispatch(setInstallComplete(arg.data));
|
||||
completedCallback(source, arg.data);
|
||||
}
|
||||
};
|
||||
|
||||
ipcRenderer.on(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
|
||||
|
||||
Reference in New Issue
Block a user