jayebaku commited on
Commit
ea2b41b
·
verified ·
1 Parent(s): d110060

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -0
app.py CHANGED
@@ -176,6 +176,14 @@ with gr.Blocks(fill_width=True) as demo:
176
 
177
  // Define a global function to reload Twitter widgets
178
  globalThis.reloadTwitterWidgets = () => {
 
 
 
 
 
 
 
 
179
  if (window.twttr && twttr.widgets) {
180
  twttr.widgets.load();
181
  }
 
176
 
177
  // Define a global function to reload Twitter widgets
178
  globalThis.reloadTwitterWidgets = () => {
179
+ // Select the container where tweets are inserted
180
+ const tweetContainer = document.getElementById("tweet-container");
181
+
182
+ if (tweetContainer) {
183
+ tweetContainer.innerHTML = ""; // Clear previous tweets
184
+ }
185
+
186
+ // Reload Twitter widgets
187
  if (window.twttr && twttr.widgets) {
188
  twttr.widgets.load();
189
  }