refactor: active room ID now only in defined in the path

This commit is contained in:
Christian Pauly 2021-06-06 10:00:52 +02:00
commit 18abb21cdb
5 changed files with 8 additions and 8 deletions

View file

@ -204,9 +204,12 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
bool webHasFocus = true;
String get activeRoomId =>
VRouter.of(navigatorContext).pathParameters['roomid'];
void _showLocalNotification(EventUpdate eventUpdate) async {
final roomId = eventUpdate.roomID;
if (webHasFocus && client.activeRoomId == roomId) return;
if (webHasFocus && activeRoomId == roomId) return;
final room = client.getRoomById(roomId);
if (room.notificationCount == 0) return;
final event = Event.fromJson(eventUpdate.content, room);