ushahidi / pwa-prototype-reporting

A PWA for reporting only purposes (compatible with ushahidi.io APIs)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Confirm posts were successfully sent to the server before emptying the offline posts array in localStorage

NidhiKJha opened this issue · comments

In form.js

formDataArray.map(formData => { postFormData(formData, this.state.token.access_token); }); localStorage.removeItem("Failed Form Submission Data");

Ensure the localStorage is removed only after the data is sent successfully.

Editing for more clarity on what's left here

This is now part of the pull request here #9.
The enhancement is working so far in my local testing.

@all-contributors please add @NidhiKJha for code and doc

@rowasc

I've put up a pull request to add @NidhiKJha! 🎉