Fix AwaitComplete runtime error (#4325)

This commit is contained in:
Daniel Girtler 2026-03-26 23:04:43 +11:00 committed by GitHub
parent dc64e15327
commit 4b9087e2f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 1 deletions

View File

@ -113,7 +113,9 @@ class LoadingScreen(BaseScreen[ValueT]):
def _exec_callback(self) -> None: def _exec_callback(self) -> None:
assert self._data_callback assert self._data_callback
result = self._data_callback() result = self._data_callback()
_ = self.dismiss(Result(ResultType.Selection, _data=result)) # cannot call self.dismiss directly from
# background thread (thread=true) as there's no event loop
self.app.call_from_thread(self.dismiss, Result(ResultType.Selection, _data=result))
def action_pop_screen(self) -> None: def action_pop_screen(self) -> None:
_ = self.dismiss() _ = self.dismiss()