Wajahat698 commited on
Commit
74b4fef
·
verified ·
1 Parent(s): bada308

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -3
app.py CHANGED
@@ -1682,7 +1682,10 @@ def handle_save_trustbuilder(content, specified_bucket=None):
1682
  """
1683
  Handles saving TrustBuilders by detecting or automatically allocating the Trust Bucket.
1684
  """
1685
- # Trust Bucket definitions with expanded keywords
 
 
 
1686
  trust_buckets = {
1687
  "Stability": [
1688
  "track record", "longevity", "size", "stability", "experience", "established", "heritage",
@@ -1747,9 +1750,13 @@ def handle_save_trustbuilder(content, specified_bucket=None):
1747
  content_to_save = f"{bucket}: Brand: {brand.strip()} | {content.strip()}"
1748
  save_content(st.session_state["wix_user_id"], content_to_save)
1749
 
1750
- # Return success response
 
 
 
1751
  return f"TrustBuilder allocated to **{bucket}** and saved successfully!"
1752
-
 
1753
  # Function to update the message counter in a static location
1754
 
1755
  if "email" not in st.session_state:
 
1682
  """
1683
  Handles saving TrustBuilders by detecting or automatically allocating the Trust Bucket.
1684
  """
1685
+ # Avoid reprocessing the same content
1686
+ if "last_processed_content" in st.session_state and st.session_state["last_processed_content"] == content:
1687
+ return None # Exit if the content was already processed
1688
+
1689
  trust_buckets = {
1690
  "Stability": [
1691
  "track record", "longevity", "size", "stability", "experience", "established", "heritage",
 
1750
  content_to_save = f"{bucket}: Brand: {brand.strip()} | {content.strip()}"
1751
  save_content(st.session_state["wix_user_id"], content_to_save)
1752
 
1753
+ # Update last processed content
1754
+ st.session_state["last_processed_content"] = content
1755
+
1756
+ # Generate response
1757
  return f"TrustBuilder allocated to **{bucket}** and saved successfully!"
1758
+
1759
+
1760
  # Function to update the message counter in a static location
1761
 
1762
  if "email" not in st.session_state: