#39: Cleanup old releases and UI upgrades

This commit is contained in:
2020-02-12 13:52:32 -06:00
parent d69515506a
commit 373de7e5f5
5 changed files with 77 additions and 16 deletions

View File

@@ -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)) {