From 44e510affdc968649dd28d0f8d74af7fa8c94406 Mon Sep 17 00:00:00 2001
From: Nicolas Barthes <nicolas.barthes@cnrs.fr>
Date: Wed, 7 Aug 2024 17:04:52 +0200
Subject: [PATCH] fixed interface selection propagation through pages

---
 src/pages/2-model_creation.py | 2 +-
 src/style/header.py           | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/pages/2-model_creation.py b/src/pages/2-model_creation.py
index c2265ad..f89dd4e 100644
--- a/src/pages/2-model_creation.py
+++ b/src/pages/2-model_creation.py
@@ -4,6 +4,7 @@ from Modules import *
 from Class_Mod.DATA_HANDLING import *
 add_header()
 add_sidebar(pages_folder)
+local_css(css_file / "style_model.css")
 
 
 @st.cache_data
@@ -17,7 +18,6 @@ def delete():
             elif os.path.isdir(chemin_fichier):
                 os.rmdir(chemin_fichier)
 delete()
-local_css(css_file / "style_model.css")
 
 # Initialize the variable in session state if it doesn't exist for st.cache_data
 if 'counter' not in st.session_state:
diff --git a/src/style/header.py b/src/style/header.py
index 30719da..fe93bca 100644
--- a/src/style/header.py
+++ b/src/style/header.py
@@ -14,6 +14,8 @@ def add_header():
 def add_sidebar(pages_folder):
     if 'interface' not in st.session_state:
         st.session_state['interface'] = 'simple'
+    else:
+        st.session_state["interface"] = st.session_state.get('interface')
 
     # # TOC menu on the left
     show_pages(
-- 
GitLab