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,