You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if I provide JavaScript code in a variable, it is executed perfectly well but when I put the same code in a file "app.js" and then pass the file path in js parameter in Blocks, it doesn't work. I have added the code in reproduction below. if the same code is put in a file, the block will be unable to execute that.
It was working fine in version 4. Now I am upgrading to 5.0.
Have you searched existing issues? 🔎
I have searched and found no existing issues
Reproduction
importgradioasgrlogin_page_js="""() => { //handle launch let reload = false; let gradioURL = new URL(window.location.href); if( !gradioURL.searchParams.has('__theme') || (gradioURL.searchParams.has('__theme') && gradioURL.searchParams.get('__theme') !== 'dark') ) { gradioURL.searchParams.delete('__theme'); gradioURL.searchParams.set('__theme', 'dark'); reload = true; } if(reload) { window.location.replace(gradioURL.href); }}"""withgr.Blocks(
js=login_page_js
) aslogin_page:
gr.Button("Sign in with Microsoft", elem_classes="icon-button" ,link="/login")
if__name__=="__main__":
login_page.launch()
Screenshot
No response
Logs
No response
System Info
linux 2204
Severity
I can work around it
The text was updated successfully, but these errors were encountered:
Thankyou @abidlabs . I have edited and added the reproduction code, you will be able to run the above example successfully and your page will shift to dark theme, but when you shift the same code to a file and provide file path in js, it will not work.
Describe the bug
if I provide JavaScript code in a variable, it is executed perfectly well but when I put the same code in a file "app.js" and then pass the file path in
js
parameter inBlocks
, it doesn't work. I have added the code in reproduction below. if the same code is put in a file, the block will be unable to execute that.It was working fine in version 4. Now I am upgrading to 5.0.
Have you searched existing issues? 🔎
Reproduction
Screenshot
No response
Logs
No response
System Info
Severity
I can work around it
The text was updated successfully, but these errors were encountered: