Skip to content

Conversation

@TDimuth
Copy link

@TDimuth TDimuth commented Oct 2, 2023

No description provided.

Comment on lines +1 to +6
REACT_APP_API_KEY=AIzaSyBoO1cF3m--z1OKJUNaflL5drrTA0aebaE
REACT_APP_AUTH_DOMIAN=dear-diary-thusara-9535b.firebaseapp.com
REACT_APP_PROJECT_ID=dear-diary-thusara-9535b
REACT_APP_STORAGE_BUCKET=dear-diary-thusara-9535b.appspot.com
REACT_APP_SENDER_ID=458518884342
REACT_APP_APP_ID=1:458518884342:web:9b1c0526c179fbf82c21d7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't commit env values

};
dispatch(addCard(newDiaryEntry));

const docRef = await addDoc(collection(db, "cards"), newDiaryEntry);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't call APIs directly from the UI file, use saga to handle API calls

dispatch(addCard(newDiaryEntry));

const docRef = await addDoc(collection(db, "cards"), newDiaryEntry);
console.log("Document written with ID: ", docRef.id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unwanted logs

const dispatch = useDispatch();

useEffect(() => {
const unsubscribe = onSnapshot(query(collection(db, 'cards')), (snapShot) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move to saga

// https://firebase.google.com/docs/web/setup#available-libraries

// Your web app's Firebase configuration
console.log(process.env.REACT_APP_API_KEY)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove logs

Copy link
Contributor

@shamal-iroshan shamal-iroshan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix commented things

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants