refactor: Follow up handle logout and login with new client
This commit is contained in:
parent
2ba5b1170d
commit
2616ba6e4b
5 changed files with 26 additions and 15 deletions
|
|
@ -25,7 +25,8 @@ class HomeserverPickerView extends StatelessWidget {
|
|||
final theme = Theme.of(context);
|
||||
|
||||
return LoginScaffold(
|
||||
enforceMobileMode: Matrix.of(context).client.isLogged(),
|
||||
enforceMobileMode:
|
||||
Matrix.of(context).widget.clients.any((client) => client.isLogged()),
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text(
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class LoginController extends State<Login> {
|
|||
identifier = AuthenticationUserIdentifier(user: username);
|
||||
}
|
||||
final client = await matrix.getLoginClient();
|
||||
client.login(
|
||||
await client.login(
|
||||
LoginType.mLoginPassword,
|
||||
identifier: identifier,
|
||||
// To stay compatible with older server versions
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ class LoginView extends StatelessWidget {
|
|||
final titleParts = title.split(homeserver);
|
||||
|
||||
return LoginScaffold(
|
||||
enforceMobileMode: Matrix.of(context).client.isLogged(),
|
||||
enforceMobileMode:
|
||||
Matrix.of(context).widget.clients.any((client) => client.isLogged()),
|
||||
appBar: AppBar(
|
||||
leading: controller.loading ? null : const Center(child: BackButton()),
|
||||
automaticallyImplyLeading: !controller.loading,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue