diff --git a/dyno_viewer/app.py b/dyno_viewer/app.py index d1f0cd6..73069d1 100644 --- a/dyno_viewer/app.py +++ b/dyno_viewer/app.py @@ -213,10 +213,10 @@ async def on_query_screen_run_query(self, run_query: QueryScreen.RunQuery) -> No if run_query.filter_cond_exp: params["FilterExpression"] = run_query.filter_cond_exp - + if run_query.index != "table": params["IndexName"] = run_query.index - + self.dyn_query_params = params self.run_table_query(params) @@ -232,8 +232,13 @@ async def on_update_dyn_data_table(self, update_data: UpdateDynDataTable) -> Non # action methods async def action_exit(self) -> None: + if not self.query(DataDynTable): + # ensure we don't have any dirty data for next time app runs + table = self.query_one(DataDynTable) + table.clear() + else: + self.pop_screen() table = self.query_one(DataDynTable) - # ensure we don't have any dirty data for next time app runs table.clear() self.app.exit()