Skip to content

Commit

Permalink
constant
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed May 11, 2024
1 parent 42bb91b commit aaa5b11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/textual/widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -625,15 +625,15 @@ def set_loading(self, loading: bool) -> Awaitable:
Returns:
An optional awaitable.
"""

LOADING_INDICATOR_CLASS = "-textual-loading-indicator"
if loading:
loading_indicator = self.get_loading_widget()
loading_indicator.add_class("-textual-loading-indicator")
loading_indicator.add_class(LOADING_INDICATOR_CLASS)
await_mount = self.mount(loading_indicator)
return await_mount
else:
for child in self.children:
if child.has_class("-textual-loading-indicator"):
if child.has_class(LOADING_INDICATOR_CLASS):
return child.remove()
dummy_awaitable: Future[None] = Future()
dummy_awaitable.set_result(None)
Expand Down

0 comments on commit aaa5b11

Please sign in to comment.