Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
fairblue
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hosting
chat
fairblue
Commits
6a94db46
Commit
6a94db46
authored
6 years ago
by
Vitor Mateus
Browse files
Options
Downloads
Patches
Plain Diff
Fix unread message indicator remains active #6624
parent
37fee4ae
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bigbluebutton-html5/imports/ui/components/nav-bar/container.jsx
+5
-13
5 additions, 13 deletions
...ebutton-html5/imports/ui/components/nav-bar/container.jsx
with
5 additions
and
13 deletions
bigbluebutton-html5/imports/ui/components/nav-bar/container.jsx
+
5
−
13
View file @
6a94db46
...
...
@@ -8,13 +8,11 @@ import Auth from '/imports/ui/services/auth';
import
{
meetingIsBreakout
}
from
'
/imports/ui/components/app/service
'
;
import
getFromUserSettings
from
'
/imports/ui/services/users-settings
'
;
import
userListService
from
'
../user-list/service
'
;
import
ChatService
from
'
../chat/service
'
;
import
Service
from
'
./service
'
;
import
NavBar
from
'
./component
'
;
import
mapUser
from
'
../../services/user/mapUser
'
;
const
PUBLIC_CONFIG
=
Meteor
.
settings
.
public
;
const
PUBLIC_GROUP_CHAT_ID
=
PUBLIC_CONFIG
.
chat
.
public_group_id
;
const
NavBarContainer
=
({
children
,
...
props
})
=>
(
<
NavBar
{
...
props
}
>
...
...
@@ -39,17 +37,11 @@ export default withTracker(() => {
}
const
checkUnreadMessages
=
()
=>
{
const
users
=
userListService
.
getUsers
();
// 1.map every user id
// 2.filter the user except the current user from the user array
// 3.add the public chat to the array
// 4.check current user has unread messages or not.
return
users
.
map
(
user
=>
user
.
id
)
.
filter
(
userID
=>
userID
!==
Auth
.
userID
)
.
concat
(
PUBLIC_GROUP_CHAT_ID
)
.
some
(
receiverID
=>
ChatService
.
hasUnreadMessages
(
receiverID
));
const
activeChats
=
userListService
.
getActiveChats
();
const
hasUnreadMessages
=
activeChats
.
filter
(
chat
=>
chat
.
id
!==
Session
.
get
(
'
idChatOpen
'
))
.
some
(
chat
=>
chat
.
unreadCounter
>
0
);
return
hasUnreadMessages
;
};
Meetings
.
find
({
meetingId
:
Auth
.
meetingID
}).
observeChanges
({
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment