RajaThor commited on
Commit
a276bce
·
verified ·
1 Parent(s): 85e698a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -65,7 +65,7 @@ def create_user(email, password):
65
  return False, None
66
 
67
  # Function to send a message
68
- def send_message(sender, recipient, message):
69
  try:
70
  # Add a new document with a generated ID to Firestore
71
  db_firestore.collection("messages").add({
@@ -274,7 +274,7 @@ def chat_ui():
274
  recipient = st.text_input("Recipient", help="Enter the recipient's email address")
275
  message = st.text_area("Message", help="Type your message here")
276
  if st.button("Send"):
277
- result = send_message(sender, recipient, message)
278
  st.write(result)
279
  st.header("Messages (Firestore)")
280
  retrieve_messages_firestore()
 
65
  return False, None
66
 
67
  # Function to send a message
68
+ def send_message(db_firestore, db_realtime, sender, recipient, message):
69
  try:
70
  # Add a new document with a generated ID to Firestore
71
  db_firestore.collection("messages").add({
 
274
  recipient = st.text_input("Recipient", help="Enter the recipient's email address")
275
  message = st.text_area("Message", help="Type your message here")
276
  if st.button("Send"):
277
+ result = send_message(db_firestore, db_realtime, sender, recipient, message)
278
  st.write(result)
279
  st.header("Messages (Firestore)")
280
  retrieve_messages_firestore()