4/15/2023 0 Comments Exif data viewer gps coordinatesAnd since I cannot use “history.push” due to context problem, I am not even able to redirect to a different component. Furthermore, as soon as I leave the callback function, I will no longer have access to the JSON data. Now my Redux store is outdated when I refresh. I cannot perform “(data)”, nor can I perform “tState” because of the context of “this” in the callback is still the picture file.Ĭonsequently, I cannot use the JSON data I received back from the backend to update the Redux store, even though the just uploaded poop report has been added to the database via “fetch”. Any reference using “this” results in an error “cannot read property “….” of undefined”. Within the callback function, “this” has the context of the picture file being processed (see lines 77, 78, 79). I am not able to do any of that in this callback. In a normal React/Redux app, in the second “.then” after a “fetch”, we usually call a function to update the Redux store (“(data)” followed by redirecting to the page I want to display after the Redux store is refreshed with the newly added data (notice I commented out “(‘/reports’)). In order to make sure the GPS data is uploaded when captured, I need to execute all the backend operations (fetch related code) within the callback. This is executed asynchronously so that means the callback function is executed whenever the file data comes back. The issue I am having is the callback function in the EXIF.getData method. The code above seems straightforward enough.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |