mirror of
https://github.com/ihabunek/toot.git
synced 2024-12-04 14:46:33 -05:00
Focus status after posting
This commit is contained in:
parent
4deccee754
commit
5213eb1835
@ -280,7 +280,11 @@ class TUI(urwid.Frame):
|
||||
data = api.post_status(self.app, self.user, content,
|
||||
spoiler_text=warning, visibility=visibility)
|
||||
status = Status(data, self.app.instance)
|
||||
|
||||
# TODO: instead of this, fetch new items from the timeline?
|
||||
self.timeline.prepend_status(status)
|
||||
self.timeline.focus_status(status)
|
||||
|
||||
self.footer.set_message("Status posted {} \\o/".format(status.id))
|
||||
self.close_overlay()
|
||||
|
||||
|
@ -150,6 +150,10 @@ class Timeline(urwid.Columns):
|
||||
return n
|
||||
raise ValueError("Status with ID {} not found".format(id))
|
||||
|
||||
def focus_status(self, status):
|
||||
index = self.get_status_index(status.id)
|
||||
self.status_list.body.set_focus(index)
|
||||
|
||||
def update_status(self, status):
|
||||
"""Overwrite status in list with the new instance and redraw."""
|
||||
index = self.get_status_index(status.id)
|
||||
|
Loading…
Reference in New Issue
Block a user