mirror of
https://github.com/oobabooga/text-generation-webui.git
synced 2026-04-05 06:35:15 +00:00
Fix light/dark theme persistence across page reloads
This commit is contained in:
parent
78899244d5
commit
eb0ab9db1d
2 changed files with 21 additions and 6 deletions
|
|
@ -31,7 +31,7 @@ def create_ui():
|
|||
|
||||
shared.gradio['toggle_dark_mode'].click(
|
||||
lambda x: 'dark' if x == 'light' else 'light', gradio('theme_state'), gradio('theme_state')).then(
|
||||
None, None, None, js=f'() => {{{ui.dark_theme_js}; toggleDarkMode()}}')
|
||||
None, None, None, js=f'() => {{{ui.dark_theme_js}; toggleDarkMode(); localStorage.setItem("theme", document.body.classList.contains("dark") ? "dark" : "light")}}')
|
||||
|
||||
# Reset interface event
|
||||
shared.gradio['reset_interface'].click(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue