Skip to content

Commit 9912b69

Browse files
Samudra-Gpre-commit-ci[bot]Devasycoderabbitai[bot]
authored
Fix: Ensure st.set_page_config is first Streamlit call in Home page (#97)
* Fix: Ensure st.set_page_config is first Streamlit call in Home page * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update ui-poc/Home.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Devasy Patel <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent ca38e84 commit 9912b69

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

ui-poc/Home.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
1-
import json
2-
from datetime import datetime
3-
1+
from streamlit_cookies_manager import EncryptedCookieManager
42
import requests
3+
from datetime import datetime
4+
import json
55
import streamlit as st
6-
from streamlit_cookies_manager import EncryptedCookieManager
6+
7+
# Configure the page – must come immediately after importing Streamlit
8+
st.set_page_config(
9+
page_title="Splitwiser",
10+
page_icon="💰",
11+
layout="wide",
12+
initial_sidebar_state="expanded",
13+
)
14+
15+
16+
# 3rd-party / std-lib imports – safe after the call above
717

818
# Configure the page
919
st.set_page_config(
@@ -12,6 +22,11 @@
1222
layout="wide",
1323
initial_sidebar_state="expanded",
1424
)
25+
# NOTE:
26+
# set_page_config() must be the very first Streamlit command,
27+
# placed right after `import streamlit as st` and before any
28+
# other `st.` calls (even indirectly via imports).
29+
1530

1631
# Initialize session state variables
1732
if "access_token" not in st.session_state:

0 commit comments

Comments
 (0)