Spaces:
Build error
Build error
Update app.py
Browse files
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 |
-
|
|
|
|
| 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(
|