Initial Skynet premium portal suppport
This commit is contained in:
@@ -6,11 +6,15 @@ import { getIPCRenderer } from '../../utils.jsx';
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
let yesNoResolvers = [];
|
||||
|
||||
export const confirmYesNo = (title) => {
|
||||
export const confirmYesNo = (title, cb) => {
|
||||
return (dispatch) => {
|
||||
return new Promise((resolve) => {
|
||||
dispatch(handleConfirmYesNo(true, title, resolve));
|
||||
});
|
||||
if (cb) {
|
||||
dispatch(confirmYesNo(title)).then((confirmed) => cb(confirmed));
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
dispatch(handleConfirmYesNo(true, title, resolve));
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -116,7 +120,7 @@ export const setRebootRequired = () => {
|
||||
};
|
||||
|
||||
export const showWindow = () => {
|
||||
return (_) => {
|
||||
return () => {
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.send(Constants.IPC_Show_Window);
|
||||
}
|
||||
|
||||
@@ -57,13 +57,13 @@ export const downloadItem = (
|
||||
case Constants.INSTALL_TYPES.Upgrade:
|
||||
// const info =
|
||||
// this.props.LocationsLookup[this.props.AppPlatform][this.props.VersionLookup[this.props.AppPlatform][0]];
|
||||
const sha256 = null; // info.sha256;
|
||||
const signature = null; // info.sig;
|
||||
//const sha256 = null; // info.sha256;
|
||||
//const signature = null; // info.sig;
|
||||
dispatch(
|
||||
installUpgrade(
|
||||
result.Destination,
|
||||
sha256,
|
||||
signature,
|
||||
null,
|
||||
null,
|
||||
!!result.SkipVerification
|
||||
)
|
||||
);
|
||||
|
||||
41
src/redux/actions/host_actions.js
Normal file
41
src/redux/actions/host_actions.js
Normal file
@@ -0,0 +1,41 @@
|
||||
let addEditHostResolvers = [];
|
||||
|
||||
export const addEditHost = (display, host_data, cb) => {
|
||||
return (dispatch) => {
|
||||
if (cb) {
|
||||
dispatch(addEditHost(display, host_data)).then(({ changed, host_data }) =>
|
||||
cb(changed, host_data)
|
||||
);
|
||||
} else {
|
||||
return new Promise((resolve) => {
|
||||
dispatch(handleDisplayAddEditHost(display, host_data, resolve));
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
const handleDisplayAddEditHost = (display, host_data, resolve) => {
|
||||
return (dispatch) => {
|
||||
if (display) {
|
||||
addEditHostResolvers.push(resolve);
|
||||
dispatch(displayAddEditHost(display, host_data));
|
||||
} else {
|
||||
dispatch(completeAddEditHost(false));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
export const completeAddEditHost = (changed, host_data) => {
|
||||
return (dispatch) => {
|
||||
if (changed) {
|
||||
addEditHostResolvers[0]({ changed, host_data });
|
||||
}
|
||||
addEditHostResolvers.splice(0, 1);
|
||||
dispatch(displayAddEditHost(false));
|
||||
};
|
||||
};
|
||||
|
||||
export const DISPLAY_ADD_EDIT_HOST = 'host/displayAddEditHost';
|
||||
export const displayAddEditHost = (display, host_data) => {
|
||||
return { type: DISPLAY_ADD_EDIT_HOST, payload: { display, host_data } };
|
||||
};
|
||||
@@ -31,7 +31,7 @@ export const clearUIUpgrade = () => {
|
||||
};
|
||||
|
||||
const cleanupOldReleases = (versionList) => {
|
||||
return (_) => {
|
||||
return () => {
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.sendSync(Constants.IPC_Cleanup_Releases + '_sync', {
|
||||
|
||||
Reference in New Issue
Block a user