GuglielmoTor commited on
Commit
faf26ff
·
verified ·
1 Parent(s): 9d99925

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -151,18 +151,24 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="blue", secondary_hue="sky"),
151
  outputs=[status_box, token_state]
152
  )
153
 
154
- fetch_dashboard_btn.click(fn=guarded_fetch_posts, inputs=[token_state], outputs=[dashboard_html])
155
 
156
-
157
  app.load(fn=check_token_status, inputs=[token_state], outputs=status_box)
158
  gr.Timer(5.0).tick(fn=check_token_status, inputs=[token_state], outputs=status_box)
159
 
160
  with gr.Tabs():
161
  with gr.TabItem("1️⃣ Dashboard"):
162
  gr.Markdown("View your organization's recent posts and their engagement statistics.")
163
- fetch_dashboard_btn = gr.Button("📊 Fetch Posts & Stats", variant="primary")
164
- dashboard_html = gr.HTML("<p style='text-align: center; color: #555;'>Waiting for token...</p>")
165
- fetch_dashboard_btn.click(fn=guarded_fetch_dashboard, inputs=[token_state], outputs=[dashboard_html])
 
 
 
 
 
 
 
 
166
 
167
  with gr.TabItem("2️⃣ Analytics"):
168
  gr.Markdown("View follower count and monthly gains for your organization.")
 
151
  outputs=[status_box, token_state]
152
  )
153
 
 
154
 
 
155
  app.load(fn=check_token_status, inputs=[token_state], outputs=status_box)
156
  gr.Timer(5.0).tick(fn=check_token_status, inputs=[token_state], outputs=status_box)
157
 
158
  with gr.Tabs():
159
  with gr.TabItem("1️⃣ Dashboard"):
160
  gr.Markdown("View your organization's recent posts and their engagement statistics.")
161
+
162
+ sync_posts_to_bubble_btn = gr.Button("🔄 Fetch, Analyze & Store Posts to Bubble", variant="primary")
163
+ dashboard_html_output = gr.HTML("<p style='text-align: center; color: #555;'>Click the button to fetch posts and store them in Bubble. Status will appear here.</p>")
164
+
165
+ # Corrected: The click handler now calls guarded_fetch_posts
166
+ # and dashboard_html_output is correctly defined in this scope.
167
+ sync_posts_to_bubble_btn.click(
168
+ fn=guarded_fetch_posts,
169
+ inputs=[token_state],
170
+ outputs=[dashboard_html_output]
171
+ )
172
 
173
  with gr.TabItem("2️⃣ Analytics"):
174
  gr.Markdown("View follower count and monthly gains for your organization.")