working good state
This commit is contained in:
@@ -15,7 +15,7 @@ def action_next(app) -> None:
|
||||
"""Show the next email message by finding the next higher ID from the list of envelope IDs."""
|
||||
try:
|
||||
result = subprocess.run(
|
||||
["himalaya", "envelope", "list", "-o", "json"],
|
||||
["himalaya", "envelope", "list", "-o", "json", "-s", "9999"],
|
||||
capture_output=True,
|
||||
text=True
|
||||
)
|
||||
@@ -23,13 +23,13 @@ def action_next(app) -> None:
|
||||
import json
|
||||
envelopes = json.loads(result.stdout)
|
||||
ids = sorted(int(envelope['id']) for envelope in envelopes)
|
||||
for index, envelope_id in enumerate(ids):
|
||||
for envelope_id in ids:
|
||||
if envelope_id > int(app.current_message_id):
|
||||
app.show_message(envelope_id)
|
||||
return
|
||||
|
||||
app.show_status("No newer messages found.", severity="warning")
|
||||
app.show_message(envelopes[-1]['id']) # Automatically show the previous message
|
||||
app.action_newest()
|
||||
else:
|
||||
app.show_status("Failed to fetch envelope list.", severity="error")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user