fix: display a nicer toast

This commit is contained in:
Christian Pauly 2021-09-19 14:25:18 +02:00
parent feb66d6de4
commit 2353bb5c7f
2 changed files with 7 additions and 8 deletions

View File

@ -1557,6 +1557,7 @@
"placeholders": {}
},
"openCamera": "Open camera",
"oneClientLoggedOut": "One of your clients has been logged out",
"@openCamera": {
"type": "text",
"placeholders": {}

View File

@ -419,15 +419,13 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
_cancelSubs(c.clientName);
widget.clients.remove(c);
}
if (loggedInWithMultipleClients) {
// TODO: display a nicer toast
showOkAlertDialog(
useRootNavigator: false,
context: navigatorContext,
title: 'Login state of client $name changed',
message: 'New login state: $state',
okLabel: L10n.of(widget.context).ok,
if (loggedInWithMultipleClients && state != LoginState.loggedIn) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(L10n.of(context).oneClientLoggedOut),
),
);
if (state != LoginState.loggedIn) {
widget.router.currentState.to(
'/rooms',