Rammohan0504 commited on
Commit
b979efa
·
verified ·
1 Parent(s): cafd30f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -86,7 +86,7 @@ popup_js = """
86
 
87
  function addToCart(name) {
88
  google.colab.kernel.invokeFunction('notebook.add_to_cart', [name], {});
89
- closePopup();
90
  }
91
  </script>
92
  """
@@ -138,4 +138,7 @@ with gr.Blocks() as demo:
138
  outputs=cart_display
139
  )
140
 
 
 
 
141
  demo.launch()
 
86
 
87
  function addToCart(name) {
88
  google.colab.kernel.invokeFunction('notebook.add_to_cart', [name], {});
89
+ closePopup(); // Automatically close the popup
90
  }
91
  </script>
92
  """
 
138
  outputs=cart_display
139
  )
140
 
141
+ # Register the backend function for JavaScript integration
142
+ demo.add_to_cart = add_to_cart
143
+
144
  demo.launch()