Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions backend/chainlit/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,10 @@ def get_html_template(root_path):
js += f"""<script src="{config.ui.custom_js}" {config.ui.custom_js_attributes}></script>"""

font = None
if custom_theme and custom_theme.get("custom_fonts"):
if custom_theme and "custom_fonts" in custom_theme:
font = "\n".join(
f"""<link rel="stylesheet" href="{font}">"""
for font in custom_theme.get("custom_fonts")
f"""<link rel="stylesheet" href="{f}">"""
for f in custom_theme["custom_fonts"]
)

index_html_file_path = os.path.join(build_dir, "index.html")
Expand All @@ -425,7 +425,7 @@ def get_html_template(root_path):
content = content.replace(JS_PLACEHOLDER, js)
if css:
content = content.replace(CSS_PLACEHOLDER, css)
if font:
if font is not None:
content = replace_between_tags(
content, "<!-- FONT START -->", "<!-- FONT END -->", font
)
Expand Down
Loading