Wajahat698 commited on
Commit
4b94984
·
verified ·
1 Parent(s): 825f6a6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -722,12 +722,13 @@ def side():
722
 
723
  # Fetch documents from Firebase
724
  if "documents" not in st.session_state:
 
725
  try:
726
  docs = db.child("users").child(st.session_state["wix_user_id"]).child("KnowledgeBase").get().val()
727
- st.session_state["documents"] = docs if docs else {}
 
728
  except Exception as e:
729
  st.sidebar.error(f"Error fetching documents: {e}")
730
- st.session_state["documents"] = {}
731
 
732
  # Display saved documents
733
  saved_docs = "\n".join(
 
722
 
723
  # Fetch documents from Firebase
724
  if "documents" not in st.session_state:
725
+ st.session_state["documents"] = {}
726
  try:
727
  docs = db.child("users").child(st.session_state["wix_user_id"]).child("KnowledgeBase").get().val()
728
+ if docs:
729
+ st.session_state["documents"] = docs
730
  except Exception as e:
731
  st.sidebar.error(f"Error fetching documents: {e}")
 
732
 
733
  # Display saved documents
734
  saved_docs = "\n".join(