Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
EnhancedJax committed Jan 11, 2025
2 parents 7a14694 + 37fa237 commit 6b47533
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.2.4

- Fixed: Crash when changing offset without app being ready

## 0.2.3

- Added amounts in insight bar legends
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "Bagels"
version = "0.2.3"
version = "0.2.4"
authors = [
{ name = "Jax", email = "[email protected]" }
]
Expand Down
6 changes: 4 additions & 2 deletions src/bagels/home.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from datetime import datetime, timedelta
from pprint import isreadable

from textual.app import ComposeResult
from textual.binding import Binding
Expand Down Expand Up @@ -97,12 +98,13 @@ def on_mount(self) -> None:
# -------------- Helpers ------------- #

def rebuild(self) -> None:
self.record_module.rebuild()
self.insights_module.rebuild()
self.accounts_module.rebuild()
self.income_mode_module.rebuild()
self.date_mode_module.rebuild()
self.templates_module.rebuild()
if self.isReady:
self.record_module.rebuild()
self.templates_module.rebuild()

def get_filter_label(self) -> str:
return format_period_to_readable(self.filter)
Expand Down
23 changes: 14 additions & 9 deletions src/bagels/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from textual.types import IgnoreReturnCallbackType

from bagels.config import CONFIG, write_state
from bagels.modals.confirmation import ConfirmationModal
from bagels.models.database.app import wipe_database
from bagels.managers.samples import create_sample_entries

Expand Down Expand Up @@ -33,12 +34,12 @@ def commands(
"Create sample entries defined in static/sample_entries.yaml",
False,
),
# (
# "dev: wipe database",
# self._action_wipe_database,
# "Delete everything from the database",
# False,
# ),
(
"dev: wipe database",
self._action_wipe_database,
"Delete everything from the database",
False,
),
*self.get_theme_commands(),
]

Expand Down Expand Up @@ -104,11 +105,15 @@ def _action_create_sample_entries(self) -> None:
def _action_wipe_database(self) -> None:
wipe_database()
self.app.refresh(layout=True, recompose=True)

# def check_delete(result) -> None:

# self.app.push_screen(ConfirmationModal(
# message="Are you sure you want to wipe the database?",
# ), callback=check_delete)
# self.app.push_screen(
# ConfirmationModal(
# message="Are you sure you want to wipe the database?",
# ),
# callback=check_delete,
# )

def _action_toggle_update_check(self) -> None:
cur = CONFIG.state.check_for_updates
Expand Down
2 changes: 1 addition & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6b47533

Please sign in to comment.