fix: display a nicer toast
This commit is contained in:
parent
59f9a9f447
commit
0b4498e9d8
2 changed files with 7 additions and 8 deletions
|
|
@ -1557,6 +1557,7 @@
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
},
|
},
|
||||||
"openCamera": "Open camera",
|
"openCamera": "Open camera",
|
||||||
|
"oneClientLoggedOut": "One of your clients has been logged out",
|
||||||
"@openCamera": {
|
"@openCamera": {
|
||||||
"type": "text",
|
"type": "text",
|
||||||
"placeholders": {}
|
"placeholders": {}
|
||||||
|
|
|
||||||
|
|
@ -419,15 +419,13 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
|
||||||
_cancelSubs(c.clientName);
|
_cancelSubs(c.clientName);
|
||||||
widget.clients.remove(c);
|
widget.clients.remove(c);
|
||||||
}
|
}
|
||||||
if (loggedInWithMultipleClients) {
|
if (loggedInWithMultipleClients && state != LoginState.loggedIn) {
|
||||||
// TODO: display a nicer toast
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
showOkAlertDialog(
|
SnackBar(
|
||||||
useRootNavigator: false,
|
content: Text(L10n.of(context).oneClientLoggedOut),
|
||||||
context: navigatorContext,
|
),
|
||||||
title: 'Login state of client $name changed',
|
|
||||||
message: 'New login state: $state',
|
|
||||||
okLabel: L10n.of(widget.context).ok,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (state != LoginState.loggedIn) {
|
if (state != LoginState.loggedIn) {
|
||||||
widget.router.currentState.to(
|
widget.router.currentState.to(
|
||||||
'/rooms',
|
'/rooms',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue