diff --git a/bigbluebutton-html5/imports/startup/client/base.jsx b/bigbluebutton-html5/imports/startup/client/base.jsx index ddd2878d18..80b7d8e147 100755 --- a/bigbluebutton-html5/imports/startup/client/base.jsx +++ b/bigbluebutton-html5/imports/startup/client/base.jsx @@ -28,12 +28,14 @@ const propTypes = { locale: PropTypes.string, approved: PropTypes.bool, meetingEnded: PropTypes.bool, + meetingExist: PropTypes.bool, }; const defaultProps = { locale: undefined, approved: undefined, meetingEnded: false, + meetingExist: false, }; class Base extends Component { @@ -48,14 +50,14 @@ class Base extends Component { this.updateLoadingState = this.updateLoadingState.bind(this); } - componentDidUpdate(prevProps) { + componentDidUpdate(prevProps, prevState) { const { ejected, approved, meetingExist, animations, } = this.props; - const { loading } = this.state; + const { loading, meetingExisted } = this.state; if (!prevProps.meetingExist && meetingExist) { Session.set('isMeetingEnded', false); @@ -76,6 +78,11 @@ class Base extends Component { Session.set('isMeetingEnded', true); } + // In case the meteor restart avoid error log + if (Meteor.status().connected && (prevState.meetingExisted !== meetingExisted)) { + this.setMeetingExisted(false); + } + if (animations && animations !== prevProps.animations) { document.documentElement.style.setProperty('--enableAnimation', 1); } else if (!animations && animations !== prevProps.animations) { @@ -105,7 +112,6 @@ class Base extends Component { meetingExist, } = this.props; - if (meetingExisted && !meetingExist) { AudioManager.exitAudio(); return (); @@ -172,22 +178,10 @@ const BaseContainer = withTracker(() => { const subscriptionsHandlers = SUBSCRIPTIONS_NAME .map(name => Meteor.subscribe(name, credentials, subscriptionErrorHandler)); - const subscriptionsReady = subscriptionsHandlers.every(handler => handler.ready()); - - const meeting = Meetings.findOne({ meetingId }); - - if (!meeting) { - return { - meetingExist: false, - subscriptionsReady, - }; - } + let subscriptionsReady = subscriptionsHandlers.every(handler => handler.ready()); if (!loggedIn) { - return { - locale, - subscriptionsReady: false, - }; + subscriptionsReady = false; } const chats = GroupChat.find({ @@ -236,7 +230,7 @@ const BaseContainer = withTracker(() => { groupChatMessageHandler, breakoutRoomSubscriptionHandler, animations, - meetingExist: true, + meetingExist: !!Meetings.findOne({ meetingId }), User, }; })(Base);