Open rodrigofbm opened 5 years ago
Configuring the store with redux-persist made it work. But now i'm facing a new problem.
https://i.imgur.com/4YlRFJn.png
Image subtitle: Red> the payload with the data saved offline. Black> the payload still being updated to an empty array.
How to stop it at the payload that I want (the "red" one)?
Can you send the final content of your store (for offline config) ? @rodrigofbm
@roshangm1 Now I'm getting this like that:
return (dispatch, getState) => {
let offlineData = getState().maintenanceReducer.getAllMainsResp;
dispatch({
type: GET_ALL_MAINTENANCES_SUCCESS,
payload: offlineData,
meta: {
offline: {
// the network action to execute:
effect: { url, method: 'GET', headers: { 'content-type': 'application/x-www-form-urlencoded' } },
// action to dispatch when effect succeeds:
commit: { type: GET_ALL_MAINTENANCES_COMMIT, meta: offlineData }
}
}
});
};
It's working. But, Is that right?
Are you using
offline()
orcreateOffline()
API?offline()
Store config
Please paste your config below.
Offline config
Environment
Steps to reproduce
-> Application is open on the form screen -> I cut the connection -> send to action -> close the app -> I turning on the connection -> Ok, the data is sent to the backend.
However, if I leave the app closed, I cut the connection, open the app, go to the form screen and do the rest of the steps, it does not send the data to the back end when I have a connection.