Partial import processing
This commit is contained in:
@@ -53,6 +53,17 @@ const handleConfirmYesNo = (show, titleOrConfirmed, resolve) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const NOTIFY_APPLICATION_BUSY = 'common/notifyApplicationBusy';
|
||||
export const notifyApplicationBusy = (busy, transparent) => {
|
||||
return {
|
||||
type: NOTIFY_APPLICATION_BUSY,
|
||||
payload: {
|
||||
busy,
|
||||
transparent
|
||||
},
|
||||
};
|
||||
};
|
||||
|
||||
export const notifyRebootRequired = createAction('common/notifyRebootRequired');
|
||||
|
||||
export const rebootSystem = () => {
|
||||
|
||||
@@ -1,27 +1,4 @@
|
||||
import {createAction} from '@reduxjs/toolkit';
|
||||
import {getIPCRenderer} from '../../utils';
|
||||
import * as Constants from '../../constants';
|
||||
import {notifyError} from './error_actions';
|
||||
|
||||
export const displaySkynetExport = createAction('skynet/displaySkynetExport');
|
||||
export const displaySkynetImport = createAction('skynet/displaySkynetImport');
|
||||
|
||||
export const importSkylinks = (version, jsonArray) => {
|
||||
return dispatch => {
|
||||
const ipcRenderer = getIPCRenderer();
|
||||
if (ipcRenderer) {
|
||||
ipcRenderer.once(Constants.IPC_Import_Skylinks_Reply, (_, arg) => {
|
||||
if (arg.data.Success) {
|
||||
|
||||
} else {
|
||||
dispatch(notifyError(arg.data.Error));
|
||||
}
|
||||
});
|
||||
|
||||
ipcRenderer.send(Constants.IPC_Import_Skylinks, {
|
||||
Version: version,
|
||||
JsonArray: jsonArray,
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import {createReducer} from '@reduxjs/toolkit';
|
||||
import {
|
||||
DISPLAY_CONFIRM_YES_NO,
|
||||
NOTIFY_APPLICATION_BUSY,
|
||||
notifyRebootRequired,
|
||||
setAllowMount,
|
||||
setApplicationReady,
|
||||
@@ -11,6 +12,8 @@ import {
|
||||
export const createCommonReducer = (platformInfo, version) => {
|
||||
return createReducer({
|
||||
AllowMount: false,
|
||||
AppBusy: false,
|
||||
AppBusyTransparent: false,
|
||||
AppPlatform: platformInfo.AppPlatform,
|
||||
AppReady: false,
|
||||
DisplayConfirmYesNo: false,
|
||||
@@ -51,6 +54,13 @@ export const createCommonReducer = (platformInfo, version) => {
|
||||
AppPlatform: action.payload,
|
||||
}
|
||||
},
|
||||
[NOTIFY_APPLICATION_BUSY]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
AppBusy: action.payload.busy,
|
||||
AppBusyTransparent: action.payload.busy && action.payload.transparent,
|
||||
};
|
||||
},
|
||||
[notifyRebootRequired]: (state, action) => {
|
||||
return {
|
||||
...state,
|
||||
|
||||
Reference in New Issue
Block a user