Fix dark mode

Fixes #7048

Co-Authored-By: J.J. Tolton <jjtolton@gmail.com>
This commit is contained in:
Shondoit 2023-01-23 09:54:42 +01:00
parent c98cb0f8ec
commit 669dbd9725

View File

@ -1942,11 +1942,11 @@ def reload_javascript():
if cmd_opts.theme is not None:
inline += f"set_theme('{cmd_opts.theme}');"
head += f'<script type="text/javascript">{inline}</script>\n'
for script in modules.scripts.list_scripts("javascript", ".js"):
head += f'<script type="text/javascript" src="file={script.path}"></script>\n'
head += f'<script type="text/javascript">{inline}</script>\n'
def template_response(*args, **kwargs):
res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
res.body = res.body.replace(b'</head>', f'{head}</head>'.encode("utf8"))