Skip to content

Commit

Permalink
Merge pull request #4305 from Textualize/reactive-from-task
Browse files Browse the repository at this point in the history
watch with async
  • Loading branch information
willmcgugan authored Mar 18, 2024
2 parents f9427e4 + c8823d8 commit 0dbc252
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/textual/widgets/_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,10 @@ def screen_sub_title(self) -> str:
return sub_title

def _on_mount(self, _: Mount) -> None:
def set_title() -> None:
async def set_title() -> None:
self.query_one(HeaderTitle).text = self.screen_title

def set_sub_title(sub_title: str) -> None:
async def set_sub_title() -> None:
self.query_one(HeaderTitle).sub_text = self.screen_sub_title

self.watch(self.app, "title", set_title)
Expand Down

0 comments on commit 0dbc252

Please sign in to comment.