How to hide a document that was clicked/viewed by the currently login user in firestore database?

M

manny

Guest
How to hide a document that was clicked/viewed by the current login user in firestore database? Whenever new data is render from firestore database it must not have a document that was clicked/viewed by this currently login user.

the componentDidMount() below is making the call to firestore

componentDidMount() {


firebase.firestore().collection("Users").limit(2)
.onSnapshot(function (querySnapshot) {

var details = [];

querySnapshot.forEach(function (doc) {
details.push(doc.data());
});

console.log(details)
});

}


and this is where the user would click to view the document/user that was fetched

<FlatList
data={details}
renderItem={({ item }) => {
return (
<View
style={{backgroundColor: '#9a7caa', height: 150,width: 150, margin: 20,}}>
<TouchableOpacity onPress={this.showUser}>
<Text>{item.name}</Text>
<Text>{item.book}</Text>
<Text>{item.number}</Text>
</TouchableOpacity>
</View>
);
}}
/>

Continue reading...
 
Top