From d5c1873c98919afdd06fd2e3259a4ea5fa82d760 Mon Sep 17 00:00:00 2001 From: Pushpam <93931528+Decoder07@users.noreply.github.com> Date: Thu, 2 Nov 2023 15:41:15 +0530 Subject: [PATCH] Added preview failure bug fix (#1623) --- packages/hms_room_kit/lib/src/preview/preview_page.dart | 3 +-- packages/hms_room_kit/lib/src/screen_controller.dart | 8 +++++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/packages/hms_room_kit/lib/src/preview/preview_page.dart b/packages/hms_room_kit/lib/src/preview/preview_page.dart index 64d0a8edd..9c5d3afeb 100644 --- a/packages/hms_room_kit/lib/src/preview/preview_page.dart +++ b/packages/hms_room_kit/lib/src/preview/preview_page.dart @@ -145,8 +145,7 @@ class _PreviewPageState extends State { meetingStore.removeListeners(), meetingStore.peerTracks.clear(), meetingStore.resetForegroundTaskAndOrientation(), - // meetingStore.clearPIPState(), - meetingStore.isRoomEnded = true, + // meetingStore.isRoomEnded = true, previewStore.isMeetingJoined = false, previewStore.hmsSDKInteractor.leave(), HMSThemeColors.resetLayoutColors(), diff --git a/packages/hms_room_kit/lib/src/screen_controller.dart b/packages/hms_room_kit/lib/src/screen_controller.dart index 74da385e9..a7ab8d809 100644 --- a/packages/hms_room_kit/lib/src/screen_controller.dart +++ b/packages/hms_room_kit/lib/src/screen_controller.dart @@ -97,9 +97,11 @@ class _ScreenControllerState extends State { /// - If successful we show the preview page void _initPreview() async { Constant.roomCode = widget.roomCode; - setState(() { - isLoading = true; - }); + if (mounted) { + setState(() { + isLoading = true; + }); + } _hmsSDKInteractor = HMSSDKInteractor( iOSScreenshareConfig: widget.options?.iOSScreenshareConfig, joinWithMutedAudio: AppDebugConfig.joinWithMutedAudio,