From 66bf810002e1128bae2bca117b747bb8d1fafbe6 Mon Sep 17 00:00:00 2001
From: Tainan Felipe <tainanfelipe214@gmail.com>
Date: Tue, 18 Dec 2018 09:04:23 -0200
Subject: [PATCH] Fix countdown doesn't appearing in breakout room

---
 .../imports/api/breakouts/server/publishers.js         |  7 ++++++-
 bigbluebutton-html5/imports/startup/client/base.jsx    | 10 ++++++----
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/bigbluebutton-html5/imports/api/breakouts/server/publishers.js b/bigbluebutton-html5/imports/api/breakouts/server/publishers.js
index c9072c6110..b01f3538db 100755
--- a/bigbluebutton-html5/imports/api/breakouts/server/publishers.js
+++ b/bigbluebutton-html5/imports/api/breakouts/server/publishers.js
@@ -8,10 +8,15 @@ function breakouts(credentials, moderator) {
     requesterUserId,
   } = credentials;
   Logger.info(`Publishing Breakouts for ${meetingId} ${requesterUserId}`);
+
   if (moderator) {
     const presenterSelector = {
-      parentMeetingId: meetingId,
+      $or: [
+        { parentMeetingId: meetingId },
+        { breakoutId: meetingId },
+      ],
     };
+
     return Breakouts.find(presenterSelector);
   }
 
diff --git a/bigbluebutton-html5/imports/startup/client/base.jsx b/bigbluebutton-html5/imports/startup/client/base.jsx
index 4428471e9d..5cd70b18d9 100755
--- a/bigbluebutton-html5/imports/startup/client/base.jsx
+++ b/bigbluebutton-html5/imports/startup/client/base.jsx
@@ -47,9 +47,9 @@ class Base extends Component {
 
   componentWillUpdate() {
     const { approved } = this.props;
-    const isLoading = this.state.loading;
+    const { loading } = this.state;
 
-    if (approved && isLoading) this.updateLoadingState(false);
+    if (approved && loading) this.updateLoadingState(false);
   }
 
   updateLoadingState(loading = false) {
@@ -131,7 +131,8 @@ const BaseContainer = withTracker(() => {
     },
   };
 
-  const subscriptionsHandlers = SUBSCRIPTIONS_NAME.map(name => Meteor.subscribe(name, credentials, subscriptionErrorHandler));
+  const subscriptionsHandlers = SUBSCRIPTIONS_NAME
+    .map(name => Meteor.subscribe(name, credentials, subscriptionErrorHandler));
 
   const chats = GroupChat.find({
     $or: [
@@ -147,7 +148,8 @@ const BaseContainer = withTracker(() => {
   const chatIds = chats.map(chat => chat.chatId);
 
   const groupChatMessageHandler = Meteor.subscribe('group-chat-msg', credentials, chatIds, subscriptionErrorHandler);
-  const User = Users.findOne({ intId: credentials.externUserID });
+  const User = Users.findOne({ intId: credentials.requesterUserId });
+
   if (User) {
     const mappedUser = mapUser(User);
     breakoutRoomSubscriptionHandler = Meteor.subscribe('breakouts', credentials, mappedUser.isModerator, subscriptionErrorHandler);
-- 
GitLab