Skip to content

Commit

Permalink
fix: Set read marker on web
Browse files Browse the repository at this point in the history
  • Loading branch information
krille-chan committed Mar 5, 2024
1 parent c7cb3bf commit fdc77fb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/pages/chat/chat.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import 'dart:async';
import 'dart:io';

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
Expand Down Expand Up @@ -394,7 +395,8 @@ class ChatController extends State<ChatPageWithRoom>
}

// Do not send read markers when app is not in foreground
if (!Matrix.of(context).webHasFocus ||
if (kIsWeb && !Matrix.of(context).webHasFocus) return;
if (!kIsWeb &&
WidgetsBinding.instance.lifecycleState != AppLifecycleState.resumed) {
return;
}
Expand Down

0 comments on commit fdc77fb

Please sign in to comment.