INNER CODE UNIT · Python
_load_state
idoavrah/terraform-tui · src/tftui/app.py:196
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.
"""
tree = self.state_tree
tree.loading = True
self.search_input.value = ""
try:
loaded = await self.client.load_state()
except TftuiError as error:
tree.loading = False
self._fail(error)
return
tree.load(loaded)