markeymarke / grocere Goto Github PK
View Code? Open in Web Editor NEWA mini-safeway web application project using React.JS, Firebase, EmailJS, and Heroku.
License: GNU General Public License v3.0
A mini-safeway web application project using React.JS, Firebase, EmailJS, and Heroku.
License: GNU General Public License v3.0
Line 186 in 6c5545e
This line passes our history array into the history component. But for some reason, the history component uses its own empty array as a state.
GrocerE/src/components/history.jsx
Line 16 in 6c5545e
This should be entirely omitted, as we should have a single source of truth, which is the history array in App.js that initializes upon loading the website. We don't need to populate the array anymore, as the users do it overtime in the DB or start with an empty array. As such, a few changes are needed such that history.jsx no longer uses this.state.products in any form.
I'm opening up this issue so we can talk about it right here or on Discord. I have a few ideas to potentially get around this. According to this post: https://stackoverflow.com/questions/37873608/how-do-i-detect-if-a-user-is-already-logged-in-firebase it seems that using var user = firebase.auth().currentUser;
from our getUID()
function inside firebase.auth().onAuthStateChanged(...)
may be a problem. This is because there are probably synchronization issues with doing this. What we could so is that outside of onAuthStateChanged we can just use getUID()
, and then check if it's null or not. If it's not null, then we can proceed and set the cart accordingly.
If that doesn't work, then notice how onAuthStateChanged provides a user field in this line: https://github.com/MarkeyMarke/cmpe133-proj/blob/439105cda187089190bab733d62ed9db7ba2c698/src/App.js#L85 with that, perhaps instead of using getUID(), we can just get the user ID directly from that user reference as a property like user.uid
, and then set the state using that uid instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.