chore: Fix client logout and update macOS
This commit is contained in:
parent
4fd8b47c57
commit
0693cc5fa6
4 changed files with 42 additions and 45 deletions
|
|
@ -62,16 +62,15 @@ class SignupPageController extends State<SignupPage> {
|
|||
try {
|
||||
final client = Matrix.of(context).getLoginClient();
|
||||
final email = emailController.text;
|
||||
if (email.isNotEmpty) {
|
||||
Matrix.of(context).currentClientSecret =
|
||||
DateTime.now().millisecondsSinceEpoch.toString();
|
||||
Matrix.of(context).currentThreepidCreds =
|
||||
await client.requestTokenToRegisterEmail(
|
||||
Matrix.of(context).currentClientSecret,
|
||||
email,
|
||||
0,
|
||||
);
|
||||
}
|
||||
Matrix.of(context).currentClientSecret =
|
||||
DateTime.now().millisecondsSinceEpoch.toString();
|
||||
Matrix.of(context).currentThreepidCreds =
|
||||
await client.requestTokenToRegisterEmail(
|
||||
Matrix.of(context).currentClientSecret,
|
||||
email,
|
||||
0,
|
||||
);
|
||||
|
||||
await client.uiaRequestBackground(
|
||||
(auth) => client.register(
|
||||
username: Matrix.of(context).loginUsername!,
|
||||
|
|
|
|||
|
|
@ -318,12 +318,10 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
|||
});
|
||||
onLoginStateChanged[name] ??= c.onLoginStateChanged.stream.listen((state) {
|
||||
final loggedInWithMultipleClients = widget.clients.length > 1;
|
||||
if (state != LoginState.loggedIn) {
|
||||
if (loggedInWithMultipleClients && state != LoginState.loggedIn) {
|
||||
_cancelSubs(c.clientName);
|
||||
widget.clients.remove(c);
|
||||
ClientManager.removeClientNameFromStore(c.clientName);
|
||||
}
|
||||
if (loggedInWithMultipleClients && state != LoginState.loggedIn) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(
|
||||
content: Text(L10n.of(context)!.oneClientLoggedOut),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue