Spaces:
Runtime error
Runtime error
Srinivasulu kethanaboina
commited on
Commit
•
a3629b9
1
Parent(s):
c6ed8dc
Update app.py
Browse files
app.py
CHANGED
@@ -149,15 +149,9 @@ with gr.Blocks(css=css) as demo:
|
|
149 |
|
150 |
# Connect the button with the function, and output the status message
|
151 |
redirect_button.click(fn=retrieve_history_and_redirect, inputs=[], outputs=redirect_message)
|
152 |
-
|
153 |
-
# Add JavaScript
|
154 |
-
|
155 |
-
<script>
|
156 |
-
document.querySelector('button').addEventListener('click', function() {
|
157 |
-
window.open('https://redfernstech.com/chat-bot-test', '_blank');
|
158 |
-
});
|
159 |
-
</script>
|
160 |
-
""")
|
161 |
|
162 |
# Launch the Gradio interface
|
163 |
demo.launch()
|
|
|
149 |
|
150 |
# Connect the button with the function, and output the status message
|
151 |
redirect_button.click(fn=retrieve_history_and_redirect, inputs=[], outputs=redirect_message)
|
152 |
+
|
153 |
+
# Add a JavaScript function to handle redirection after the Gradio event is processed
|
154 |
+
redirect_button.click(fn=None,js="() => { window.open('https://redfernstech.com/chat-bot-test', '_blank'); }")
|
|
|
|
|
|
|
|
|
|
|
|
|
155 |
|
156 |
# Launch the Gradio interface
|
157 |
demo.launch()
|