#39: Cleanup old releases and UI upgrades
This commit is contained in:
@@ -13,6 +13,7 @@ import {
|
||||
setDismissDependencies
|
||||
} from './install_actions';
|
||||
import {unmountAll} from './mount_actions';
|
||||
import {getIPCRenderer} from '../../utils';
|
||||
|
||||
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
|
||||
export const clearUIUpgrade = () => {
|
||||
@@ -22,6 +23,17 @@ export const clearUIUpgrade = () => {
|
||||
};
|
||||
};
|
||||
|
||||
const cleanupOldReleases = versionList => {
|
||||
return dispatch => {
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.sendSync(Constants.IPC_Cleanup_Releases + '_sync', {
|
||||
version_list: versionList
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const detectUIUpgrade = () => {
|
||||
return (dispatch, getState) => {
|
||||
axios
|
||||
@@ -77,6 +89,12 @@ export const loadReleases = () => {
|
||||
dispatch(setAllowDismissDependencies(versionLookup[Constants.RELEASE_TYPES[release]].length > 1));
|
||||
}
|
||||
dispatch(checkVersionInstalled());
|
||||
|
||||
let versionList = [];
|
||||
for (const key of Object.keys(locationsLookup)) {
|
||||
versionList.push(key);
|
||||
}
|
||||
dispatch(cleanupOldReleases(versionList))
|
||||
};
|
||||
|
||||
if ((version !== state.Version) || (release !== state.Release)) {
|
||||
|
||||
Reference in New Issue
Block a user