Skip to content

Commit

Permalink
refactor(visualizations): show redirect button if no dataframe found
Browse files Browse the repository at this point in the history
  • Loading branch information
benjamin-awd committed Sep 12, 2024
1 parent 3aa2120 commit 6d6601a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions webapp/pages/1_visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import plotly.graph_objs as go
import streamlit as st

from webapp.helpers import switch_page

if TYPE_CHECKING:
from streamlit.delta_generator import DeltaGenerator

Expand Down Expand Up @@ -110,3 +112,8 @@ def show_stacked_bar_chart(df: pd.DataFrame):
df = df.resample("MS").sum()

show_stacked_bar_chart(df)

if "df" not in st.session_state.keys():
switch_page_button = st.button("Convert a bank statement")
if switch_page_button:
switch_page("app")

0 comments on commit 6d6601a

Please sign in to comment.