ruff formatted
This commit is contained in:
@@ -3,15 +3,19 @@ from maildir_gtd.screens.OpenMessage import OpenMessageScreen
|
||||
|
||||
def action_open(app) -> None:
|
||||
"""Show the input modal for opening a specific message by ID."""
|
||||
|
||||
def check_id(message_id: str | None) -> bool:
|
||||
try:
|
||||
int(message_id)
|
||||
app.show_message(message_id)
|
||||
if (message_id is not None and message_id > 0):
|
||||
if message_id is not None and message_id > 0:
|
||||
app.show_message(message_id)
|
||||
except ValueError:
|
||||
app.bell()
|
||||
app.show_status("Invalid message ID. Please enter an integer.", severity="error")
|
||||
app.show_status(
|
||||
"Invalid message ID. Please enter an integer.", severity="error"
|
||||
)
|
||||
return True
|
||||
return False
|
||||
|
||||
app.push_screen(OpenMessageScreen(), check_id)
|
||||
|
||||
Reference in New Issue
Block a user