Spaces:
Runtime error
Runtime error
Commit ·
fb7ad3a
1
Parent(s): b85a2ff
Fix setup button - remove duplicate click handler
Browse files- Removed duplicate click handler on setup_btn that was causing conflicts
- Used .then() chaining to update status indicators after setup completes
- Added .then() chaining to discover_btn to auto-refresh all lists after discovery
- Dashboard stats now auto-update after prospect discovery
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
app.py
CHANGED
|
@@ -1083,7 +1083,16 @@ def create_app():
|
|
| 1083 |
""")
|
| 1084 |
|
| 1085 |
# ===== EVENT HANDLERS =====
|
| 1086 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1087 |
|
| 1088 |
reset_btn.click(
|
| 1089 |
fn=reset_all_data,
|
|
@@ -1097,7 +1106,18 @@ def create_app():
|
|
| 1097 |
|
| 1098 |
refresh_btn.click(fn=refresh_dashboard, outputs=[prospects_stat, contacts_stat, emails_stat, client_status])
|
| 1099 |
|
| 1100 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1101 |
|
| 1102 |
refresh_prospects_btn.click(fn=get_prospects_html, outputs=[prospects_list])
|
| 1103 |
refresh_contacts_btn.click(fn=get_contacts_html, outputs=[contacts_list])
|
|
@@ -1109,9 +1129,6 @@ def create_app():
|
|
| 1109 |
send_btn.click(fn=chat_with_ai, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 1110 |
chat_input.submit(fn=chat_with_ai, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 1111 |
|
| 1112 |
-
# Update statuses after setup
|
| 1113 |
-
setup_btn.click(fn=lambda: (get_client_status_html(), get_client_status_html()), outputs=[client_status, client_status_2])
|
| 1114 |
-
|
| 1115 |
return demo
|
| 1116 |
|
| 1117 |
|
|
|
|
| 1083 |
""")
|
| 1084 |
|
| 1085 |
# ===== EVENT HANDLERS =====
|
| 1086 |
+
|
| 1087 |
+
# Setup button - run setup and then update status indicators
|
| 1088 |
+
setup_btn.click(
|
| 1089 |
+
fn=setup_client_company,
|
| 1090 |
+
inputs=[client_name_input],
|
| 1091 |
+
outputs=[setup_output]
|
| 1092 |
+
).then(
|
| 1093 |
+
fn=lambda: (get_client_status_html(), get_client_status_html()),
|
| 1094 |
+
outputs=[client_status, client_status_2]
|
| 1095 |
+
)
|
| 1096 |
|
| 1097 |
reset_btn.click(
|
| 1098 |
fn=reset_all_data,
|
|
|
|
| 1106 |
|
| 1107 |
refresh_btn.click(fn=refresh_dashboard, outputs=[prospects_stat, contacts_stat, emails_stat, client_status])
|
| 1108 |
|
| 1109 |
+
# Discover prospects and then update all lists
|
| 1110 |
+
discover_btn.click(
|
| 1111 |
+
fn=discover_prospects,
|
| 1112 |
+
inputs=[num_prospects],
|
| 1113 |
+
outputs=[discovery_output]
|
| 1114 |
+
).then(
|
| 1115 |
+
fn=lambda: (get_prospects_html(), get_contacts_html(), get_emails_html()),
|
| 1116 |
+
outputs=[prospects_list, contacts_list, emails_list]
|
| 1117 |
+
).then(
|
| 1118 |
+
fn=refresh_dashboard,
|
| 1119 |
+
outputs=[prospects_stat, contacts_stat, emails_stat, client_status]
|
| 1120 |
+
)
|
| 1121 |
|
| 1122 |
refresh_prospects_btn.click(fn=get_prospects_html, outputs=[prospects_list])
|
| 1123 |
refresh_contacts_btn.click(fn=get_contacts_html, outputs=[contacts_list])
|
|
|
|
| 1129 |
send_btn.click(fn=chat_with_ai, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 1130 |
chat_input.submit(fn=chat_with_ai, inputs=[chat_input, chatbot], outputs=[chatbot, chat_input])
|
| 1131 |
|
|
|
|
|
|
|
|
|
|
| 1132 |
return demo
|
| 1133 |
|
| 1134 |
|