Merge pull request #7093 from Shondoit/fix-dark-mode

Fix dark mode
This commit is contained in:
AUTOMATIC1111 2023-01-23 15:09:26 +03:00 committed by GitHub
commit 74608300d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1686,11 +1686,11 @@ def reload_javascript():
if cmd_opts.theme is not None: if cmd_opts.theme is not None:
inline += f"set_theme('{cmd_opts.theme}');" 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"): 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" src="file={script.path}"></script>\n'
head += f'<script type="text/javascript">{inline}</script>\n'
def template_response(*args, **kwargs): def template_response(*args, **kwargs):
res = shared.GradioTemplateResponseOriginal(*args, **kwargs) res = shared.GradioTemplateResponseOriginal(*args, **kwargs)
res.body = res.body.replace(b'</head>', f'{head}</head>'.encode("utf8")) res.body = res.body.replace(b'</head>', f'{head}</head>'.encode("utf8"))