from 1 to 10??
handleSendFriendRequest = async () => {
//Change Icon
if (!this.state.friendRequestSend) {
this.setState({ friendRequestSend: true });
//Add FriendRequests Tree in sender's database
let receiver = this.props.results;
let currentUser = firebase.auth().currentUser.uid;
await firebase
.database()
.ref(
"users/" + currentUser + "/FriendRequests/sentTo/" + receiver + "/"
)
.update({
status: "Pending"
});
//Add FriendRequests Tree in receiver's database
await firebase
.database()
.ref(
"users/" +
receiver +
"/FriendRequests/receivedBy/" +
currentUser +
"/"
)
.update({
status: "Pending"
});
this.refs.toast.show("Friend Request Sent!");
}
};
@MKRhere isn't this the old-state case?
5/10
Switch to hooks when
Обсуждают сегодня