diff --git a/lib/features/thread/presentation/thread_controller.dart b/lib/features/thread/presentation/thread_controller.dart index 64cf70bea..8b3b03c09 100644 --- a/lib/features/thread/presentation/thread_controller.dart +++ b/lib/features/thread/presentation/thread_controller.dart @@ -636,7 +636,7 @@ class ThreadController extends BaseController with EmailActionController { Future _handleWebSocketMessage(WebSocketMessage message) async { try { - if (searchController.isSearchEmailRunning) { + if (searchController.isSearchEmailRunning && PlatformInfo.isWeb) { await _refreshChangeSearchEmail(); } else { await _refreshChangeListEmail(); diff --git a/test/features/thread/presentation/controller/thread_controller_test.dart b/test/features/thread/presentation/controller/thread_controller_test.dart index 549f019f4..18f3ed540 100644 --- a/test/features/thread/presentation/controller/thread_controller_test.dart +++ b/test/features/thread/presentation/controller/thread_controller_test.dart @@ -4,6 +4,7 @@ import 'package:core/presentation/state/success.dart'; import 'package:core/presentation/utils/app_toast.dart'; import 'package:core/presentation/utils/responsive_utils.dart'; import 'package:core/utils/application_manager.dart'; +import 'package:core/utils/platform_info.dart'; import 'package:dartz/dartz.dart' hide State; import 'package:flutter_test/flutter_test.dart'; import 'package:get/get.dart'; @@ -278,6 +279,7 @@ void main() { 'AND `mailboxDashBoardController.emailsInCurrentMailbox` should not be cleared', () async { // Arrange + PlatformInfo.isTestingForWeb = true; final emailList = [ PresentationEmail( id: EmailId(Id('email1')), @@ -360,6 +362,7 @@ void main() { expect(mockMailboxDashBoardController.emailsInCurrentMailbox.isNotEmpty, isTrue); expect(mockMailboxDashBoardController.emailsInCurrentMailbox.length, emailList.length); expect(threadController.isListEmailScrollViewJumping, isFalse); + PlatformInfo.isTestingForWeb = false; }); test(