mars-s / Vybe-beta

We decided to make a chat application for use at schools
1 stars 2 forks source link

Firestore data is not showing up #3

Closed mars-s closed 3 years ago

mars-s commented 3 years ago

image

There should be text from firestore showing up but it doesn't. The issue could be that the app is not fully linked to the firebase yet

The changes should look like the ones in the video at the time 7:51 https://www.youtube.com/watch?v=2-LISBTczQE

@krishp058

krishp058 commented 3 years ago

What line and what file is that in?

mars-s commented 3 years ago

What line and what file is that in?

The actions should take affect when the changes have been made in the Channel.jsx chech app.js too

mars-s commented 3 years ago

also look at the video at 7:51 where the changes take place

krishp058 commented 3 years ago

Ok ok thanks I will look into it, but I might of found to problem.

krishp058 commented 3 years ago

Ok I looked into it, but I couldn't find the issue since i'm not fluent at JS yet, but have you tried re-watching the whole video to check if all the code is perfectly the same?

krishp058 commented 3 years ago

Also could it be because of you not putting ; at the end of the lines to state that the line has ended?

bakhosRachwan commented 3 years ago

Hello, I suggest you check in firebase that the collection name is identical to that you are calling here ".collection('messages')" . Because the code looks correct to me.

krishp058 commented 3 years ago

Yep I just checked, the collection name is still in fact called 'messages'. Screenshot (5)

Do you have any other idea that would fix this issue?

krishp058 commented 3 years ago

After some google searches I found a way to display the messages.

I changed the following rule in firebase from:

rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if false; } } }

to

rules_version = '2'; service cloud.firestore { match /databases/{database}/documents { match /{document=**} { allow read, write: if true; } } }

Basically, I changed allow read, write: if false to allow read, write: if true

Messages