refactor email viewer app
This commit is contained in:
16
maildir_gtd/actions/open.py
Normal file
16
maildir_gtd/actions/open.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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) -> bool:
|
||||
try:
|
||||
int(message_id)
|
||||
app.show_status(f"Opening message {message_id}...")
|
||||
app.current_message_id = message_id
|
||||
app.show_message(app.current_message_id)
|
||||
except ValueError:
|
||||
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