Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix section name #105

Merged
merged 3 commits into from
Aug 8, 2024
Merged
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
6 changes: 5 additions & 1 deletion src/st_pages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import json
from dataclasses import dataclass
from pathlib import Path
from typing import cast

import streamlit as st
import toml
Expand Down Expand Up @@ -75,7 +76,10 @@ def _get_nav_from_toml(

for page in pages:
if page.is_section:
current_section = f"{translate_icon(page.icon)} {page.name}"
if page.icon is not None:
current_section = f"{translate_icon(page.icon)} {page.name}"
else:
current_section = cast(str, page.name)
if page.name in st.session_state[HIDE_PAGES_KEY]:
sections_to_drop.append(current_section)
continue
Expand Down