fix: Enable gotify recommendations

This commit is contained in:
Krille Fear 2021-09-24 11:42:56 +02:00
commit 26a07d1849
6 changed files with 112 additions and 55 deletions

View file

@ -519,8 +519,22 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
client,
context,
widget.router,
onFcmError: (errorMsg) => ScaffoldMessenger.of(context)
.showSnackBar(SnackBar(content: Text(errorMsg))),
onFcmError: (errorMsg, {Uri link}) => Timer(
Duration(seconds: 1),
() {
final banner = SnackBar(
content: Text(errorMsg),
duration: Duration(seconds: 30),
action: link == null
? null
: SnackBarAction(
label: L10n.of(context).link,
onPressed: () => launch(link.toString()),
),
);
ScaffoldMessenger.of(navigatorContext).showSnackBar(banner);
},
),
);
}
}