Only login if the client is logged out

This commit is contained in:
Brandon Presley 2023-12-30 11:23:57 +13:00
parent f229c0371b
commit 27b7f79d74

View File

@ -54,9 +54,10 @@ class _MyHomePageState extends State<MyHomePage> {
try {
await client.checkHomeserver(Uri.parse(homeserver));
await client.login(LoginType.mLoginPassword,
password: password,
identifier: AuthenticationUserIdentifier(user: username));
if (!client.isLogged())
await client.login(LoginType.mLoginPassword,
password: password,
identifier: AuthenticationUserIdentifier(user: username));
provider.setClient(client);
setState(() {
showRooms = true;