smol tweaks

This commit is contained in:
3wc 2023-10-29 22:28:01 +00:00
parent 4b8df70527
commit 8e2eead540

View File

@ -444,7 +444,6 @@ class CategoryListScreen(ListScreen):
self._refresh() self._refresh()
def action_delete(self) -> None: def action_delete(self) -> None:
# get the keys for the row and column under the cursor.
row_key, _ = self.table.coordinate_to_cell_key(self.table.cursor_coordinate) row_key, _ = self.table.coordinate_to_cell_key(self.table.cursor_coordinate)
category_id = self.table.get_cell_at( category_id = self.table.get_cell_at(
@ -453,7 +452,6 @@ class CategoryListScreen(ListScreen):
category = HamsterCategory.get(id=category_id) category = HamsterCategory.get(id=category_id)
category.delete_instance() category.delete_instance()
# supply the row key to `remove_row` to delete the row.
self.table.remove_row(row_key) self.table.remove_row(row_key)
@ -581,5 +579,5 @@ class HamsterToolsApp(App):
self.switch_mode("activities") self.switch_mode("activities")
def action_quit(self) -> None: def action_quit(self) -> None:
self.exit()
db.close() db.close()
self.exit()