excellent
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
|
||||
import subprocess
|
||||
import asyncio
|
||||
|
||||
def action_newest(app) -> None:
|
||||
async def action_newest(app) -> None:
|
||||
"""Show the previous email message by finding the next lower ID from the list of envelope IDs."""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["himalaya", "envelope", "list", "-o", "json", "-s", "9999"],
|
||||
capture_output=True,
|
||||
text=True
|
||||
)
|
||||
if result.returncode == 0:
|
||||
import json
|
||||
envelopes = json.loads(result.stdout)
|
||||
ids = sorted((int(envelope['id']) for envelope in envelopes), reverse=True)
|
||||
if (app.reload_needed):
|
||||
await app.action_fetch_list()
|
||||
|
||||
ids = sorted((int(envelope['id']) for envelope in app.all_envelopes), reverse=True)
|
||||
app.current_message_id = ids[0]
|
||||
app.show_message(app.current_message_id)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user