From 3c5020f1bd875c278e818372d774dacd06ce156b Mon Sep 17 00:00:00 2001 From: Christian Pauly Date: Sun, 4 Oct 2020 13:43:17 +0200 Subject: [PATCH] hotfix: login --- lib/components/matrix.dart | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/lib/components/matrix.dart b/lib/components/matrix.dart index 70a3a1f..01e46ad 100644 --- a/lib/components/matrix.dart +++ b/lib/components/matrix.dart @@ -87,13 +87,16 @@ class MatrixState extends State { try { client.database = await getDatabase(client); await client.connect(); - if (await initLoginState == LoginState.logged && PlatformInfos.isMobile) { - await FirebaseController.setupFirebase( - this, - widget.clientName, - ); + final firstLoginState = await initLoginState; + if (firstLoginState == LoginState.logged) { + _cleanUpUserStatus(userStatuses); + if (PlatformInfos.isMobile) { + await FirebaseController.setupFirebase( + this, + widget.clientName, + ); + } } - _cleanUpUserStatus(userStatuses); } catch (e, s) { client.onLoginStateChanged.sink.addError(e, s); captureException(e, s);