INNER CODE UNIT · Python
refresh_workspace
idoavrah/terraform-tui · src/tftui/app.py:184
async def refresh_workspace(self) -> None:
workspace = await self.client.current_workspace()
self.query_one("#header", AppHeader).workspace = workspace or "unknown"
def action_reload(self) -> None:
self.notify("Refreshing state")
self.reload_state()
@work(exclusive=True, group="state")
async def reload_state(self) -> None:
await self._load_state()
async def _load_state(self, *, show_tree: bool = True) -> None:
"""Reload the state into the tree.
``show_tree`` is false after an apply: the state has changed and the
tree must be rebuilt, but the user is still reading the apply output
and should not be thrown back to the tree mid-sentence.