From c38569063c34553600a3b472b66255188d595ae6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20=C5=BBebrak?= Date: Mon, 16 Sep 2024 14:03:07 +0200 Subject: [PATCH] Fix freeze after Onboarding See: - https://github.com/Textualize/textual/issues/5008 - https://github.com/Textualize/textual/issues/5064 --- .../ui/onboarding/dedicated_form_screens/finish_form_screen.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clive/__private/ui/onboarding/dedicated_form_screens/finish_form_screen.py b/clive/__private/ui/onboarding/dedicated_form_screens/finish_form_screen.py index ea6ffb113..b6511b90f 100644 --- a/clive/__private/ui/onboarding/dedicated_form_screens/finish_form_screen.py +++ b/clive/__private/ui/onboarding/dedicated_form_screens/finish_form_screen.py @@ -48,7 +48,8 @@ async def previous_screen(self) -> None: @on(CliveButton.Pressed, "#finish-button") async def finish(self) -> None: - await self.action_finish() + # Has to be done in a separate task to avoid deadlock. More: https://github.com/Textualize/textual/issues/5008 + self.app.run_worker(self.action_finish()) async def action_finish(self) -> None: await self._owner.execute_post_actions()