Make Chat show spinner until ready

Like EditAccount, instead of crashing if the room isn't loaded yet.
This commit is contained in:
miruka
2019-07-21 08:38:49 -04:00
parent 5b421f02d8
commit 246058e647
8 changed files with 178 additions and 115 deletions

View File

@@ -91,6 +91,17 @@ class Backend:
))
async def wait_until_client_exists(self, user_id: str = "") -> None:
while True:
if user_id and user_id in self.clients:
return
if not user_id and self.clients:
return
await asyncio.sleep(0.1)
# General functions
async def load_settings(self) -> Tuple[Dict[str, Any], ...]:
@@ -99,7 +110,7 @@ class Backend:
async def request_user_update_event(self, user_id: str) -> None:
if not self.clients:
return
await self.wait_until_client_exists()
client = self.clients.get(
user_id,