refactor: active room ID now only in defined in the path
This commit is contained in:
parent
dca23d3819
commit
18abb21cdb
5 changed files with 8 additions and 8 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue