Add the auto-open option to the new_diary_modal.py

This commit is contained in:
Gustavo Henrique Santos Souza de Miranda 2025-07-15 15:51:30 -03:00
parent 18760e174c
commit f838a5b421
1 changed files with 4 additions and 1 deletions

View File

@ -62,7 +62,10 @@ class NewDiaryModal(ModalScreen[str]):
created_diary = await service.async_create(name)
if created_diary:
self.dismiss(name)
self.app.push_screen(EditEntryScreen(diary_id=created_diary.id))
if self.auto_open:
self.app.push_screen(EditEntryScreen(diary_id=created_diary.id))
self.notify(f"Diary: '{name}' created!")
else:
self.notify("Error Creating the diary")