From e9f3e78cbdf1a7cee6951bce57f86273e30dc891 Mon Sep 17 00:00:00 2001 From: David Rodenkirchen Date: Wed, 28 Aug 2024 15:26:37 +0200 Subject: [PATCH] document bug, implement workaround and move on --- .../components/UserInfoAndLoginBox.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/ez_lan_manager/components/UserInfoAndLoginBox.py b/src/ez_lan_manager/components/UserInfoAndLoginBox.py index 02df408..c3bfccd 100644 --- a/src/ez_lan_manager/components/UserInfoAndLoginBox.py +++ b/src/ez_lan_manager/components/UserInfoAndLoginBox.py @@ -41,17 +41,24 @@ class UserInfoAndLoginBox(Component): @staticmethod def get_greeting() -> str: - return choice(["Grüße", "Hallo", "Willkommen", "Moin", "Ahoi"]) + return choice(["Guten Tacho", "Tuten Gag", "Hallöchen mit Öchen", "Servus", "Moinjour", "Hallöchen Popöchen", "Heyho", "Moinsen"]) + # @FixMe: If the user logs out and then tries to log back in, it does not work + # If the user navigates to another page and then tries again. It works. + # When fixed, remove the workaround below. async def logout(self) -> None: self.show_login = True await self.session[SessionStorage].clear() await self.force_refresh() - await self.refresh_cb() + # @FixMe: Workaround for the bug described above. Navigating to another page solves the issue. + # Yet, this is not desired behavior. + subpage = str(self.session.active_page_url) + if subpage.endswith("/") or subpage.endswith("news"): + self.session.navigate_to("./overview") + else: + self.session.navigate_to("./news") async def _on_login_pressed(self) -> None: - self.login_button.is_loading = True - await self.login_button.force_refresh() user_name = self.user_name_input.text.lower() if self.session[UserService].is_login_valid(user_name, self.password_input.text): self.user_name_input.is_valid = True