fix: Foreground push

This commit is contained in:
Christian Pauly 2021-01-22 13:46:49 +01:00
parent 2089e62465
commit ea1cefaab2

View File

@ -24,9 +24,11 @@ abstract class FirebaseController {
static final FlutterLocalNotificationsPlugin
_flutterLocalNotificationsPlugin = FlutterLocalNotificationsPlugin();
static BuildContext context;
static MatrixState matrix;
static Future<void> setupFirebase(
MatrixState matrix, String clientName) async {
FirebaseController.matrix = matrix;
if (!PlatformInfos.isMobile) return;
final client = matrix.client;
if (Platform.isIOS) iOS_Permission();
@ -156,7 +158,7 @@ abstract class FirebaseController {
await _flutterLocalNotificationsPlugin.cancelAll();
return null;
}
if (context != null && Matrix.of(context).activeRoomId == roomId) {
if (context != null && matrix.activeRoomId == roomId) {
Logs().i('[Push] New clearing push');
return null;
}