Skip to content

Commit

Permalink
pot: ui: Fix refreshing.
Browse files Browse the repository at this point in the history
  • Loading branch information
fishinthecalculator committed Nov 13, 2023
1 parent 263b636 commit 43f5554
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pot/ui/base/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ def _add_rows(self, rows):
row = self._value_to_row(r, self._get_columns())
self.table.add_row(*row, key=r.get_key())

def _refresh_table(self):
def _refresh_table(self, new_value):
old_selection_index = self.table.cursor_coordinate.row
self.value = new_value
self.table.clear()

if self.value:
Expand Down Expand Up @@ -99,4 +100,4 @@ async def on_mount(self) -> None:
async def refresh_screen(self) -> None:
"""Update the table for the current screen."""
async for value in poll_command(self._compute_value):
self._refresh_table()
self._refresh_table(value)

0 comments on commit 43f5554

Please sign in to comment.