#34: Allow cancelling/closing dependency installation if version count > 1
This commit is contained in:
@@ -5,6 +5,7 @@ import {getIPCRenderer} from '../../utils';
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
|
||||
export const notifyRebootRequired = createAction('common/notifyRebootRequired');
|
||||
export const setAllowMount = createAction('common/setAllowMount');
|
||||
|
||||
export const rebootSystem = () => {
|
||||
return dispatch => {
|
||||
|
||||
@@ -12,6 +12,7 @@ import {
|
||||
setReleaseUpgradeAvailable
|
||||
} from './release_version_actions';
|
||||
import {
|
||||
setAllowMount,
|
||||
setApplicationReady,
|
||||
setRebootRequired,
|
||||
showWindow,
|
||||
@@ -43,6 +44,7 @@ export const checkInstalled = (dependencies, version) => {
|
||||
dispatch(setReleaseUpgradeAvailable(upgradeAvailable));
|
||||
dispatch(setMissingDependencies(result.Dependencies));
|
||||
dispatch(setAllowDownload(true));
|
||||
dispatch(setAllowMount(true));
|
||||
if (result.Dependencies && (result.Dependencies.length > 0)) {
|
||||
dispatch(showWindow());
|
||||
}
|
||||
@@ -189,6 +191,7 @@ export const installUpgrade = (source, sha256, signature, skipVerification) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const setDismissDependencies = createAction('install/setDismissDependencies');
|
||||
export const setInstallActive = createAction('install/setInstallActive');
|
||||
export const setInstallComplete = createAction('install/setInstallComplete');
|
||||
export const setMissingDependencies = createAction('install/setMissingDependencies');
|
||||
|
||||
@@ -4,9 +4,14 @@ import {createAction} from 'redux-starter-kit';
|
||||
import {notifyError} from './error_actions';
|
||||
import {
|
||||
saveState,
|
||||
setAllowMount,
|
||||
setApplicationReady,
|
||||
showWindow
|
||||
} from './common_actions';
|
||||
import {
|
||||
checkVersionInstalled,
|
||||
setDismissDependencies
|
||||
} from './install_actions';
|
||||
import {unmountAll} from './mount_actions';
|
||||
|
||||
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
|
||||
@@ -60,16 +65,20 @@ export const loadReleases = () => {
|
||||
|
||||
dispatch(setReleaseData(locationsLookup, versionLookup));
|
||||
|
||||
const dispatchActions = () => {
|
||||
const dispatchActions = (processAllowDismiss = true) => {
|
||||
dispatch(setReleaseUpgradeAvailable((version !== latestVersion)));
|
||||
dispatch(setApplicationReady(true));
|
||||
dispatch(detectUIUpgrade());
|
||||
if (processAllowDismiss) {
|
||||
dispatch(setAllowDismissDependencies(versionLookup[Constants.RELEASE_TYPES[release]].length > 1));
|
||||
}
|
||||
dispatch(checkVersionInstalled());
|
||||
};
|
||||
|
||||
if ((version !== state.Version) || (release !== state.Release)) {
|
||||
dispatch(unmountAll(() => {
|
||||
dispatch(setActiveRelease(release, version));
|
||||
dispatchActions();
|
||||
dispatchActions(false);
|
||||
dispatch(showWindow());
|
||||
dispatch(saveState());
|
||||
}));
|
||||
@@ -112,17 +121,33 @@ export const loadReleases = () => {
|
||||
};
|
||||
};
|
||||
|
||||
export const SET_ACTIVE_RELEASE = 'relver/setActiveRelease';
|
||||
export const setActiveRelease = (release, version) => {
|
||||
export const NOTIFY_ACTIVE_RELEASE = 'relver/notifyActiveRelease';
|
||||
export const notifyActiveRelease = (release, version) => {
|
||||
return {
|
||||
type: SET_ACTIVE_RELEASE,
|
||||
type: NOTIFY_ACTIVE_RELEASE,
|
||||
payload: {
|
||||
release,
|
||||
version
|
||||
release: release,
|
||||
version: version
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const setActiveRelease = (release, version) => {
|
||||
return (dispatch, getState) => {
|
||||
dispatch(setAllowMount(false));
|
||||
const relVer = getState().relver;
|
||||
const common = getState().common;
|
||||
const versions = relVer.VersionLookup[Constants.RELEASE_TYPES[release]];
|
||||
dispatch(setAllowDismissDependencies(versions.length > 1));
|
||||
dispatch(setDismissDependencies(false));
|
||||
dispatch(notifyActiveRelease(release, version));
|
||||
if (common.AppReady) {
|
||||
dispatch(checkVersionInstalled());
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const setAllowDismissDependencies = createAction('relver/setAllowDismissDependencies');
|
||||
export const setDismissUIUpgrade = createAction('relver/setDismissUIUpgrade');
|
||||
export const setInstalledVersion = createAction('relver/setInstalledVersion');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user