Export Skylinks to json file

This commit is contained in:
2021-03-18 23:26:31 -05:00
parent 41af3c4670
commit e8fb5bd53d
10 changed files with 96 additions and 10 deletions

View File

@@ -47,11 +47,11 @@ export const notifyError = (msg, critical, callback) => {
};
};
export const notifyInfo = (title, msg) => {
export const notifyInfo = (title, msg, saveToFile, fileName, extension) => {
return (dispatch) => {
title = title ? title.toString() : 'Information';
msg = msg ? msg.toString() : '';
dispatch(setInfo(title, msg));
dispatch(setInfo(title, msg, saveToFile, fileName, extension));
};
};
@@ -61,6 +61,9 @@ export const setErrorInfo = (msg, critical) => {
};
export const SET_INFO = 'error/setInfo';
export const setInfo = (title, msg) => {
return { type: SET_INFO, payload: { title, msg } };
export const setInfo = (title, msg, saveToFile, fileName, extension) => {
return {
type: SET_INFO,
payload: { title, msg, saveToFile, fileName, extension },
};
};

View File

@@ -44,7 +44,13 @@ export const errorReducer = createReducer(
},
[SET_INFO]: (state, action) => {
const infoStack = [
{ title: action.payload.title, message: action.payload.msg },
{
title: action.payload.title,
message: action.payload.msg,
saveToFile: action.payload.saveToFile,
fileName: action.payload.fileName,
extension: action.payload.extension,
},
...state.InfoStack,
];
return { ...state, DisplayInfo: true, InfoStack: infoStack };