The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/app/threads/client/flextab/threadlist.js

22 lines
699 B

import { Meteor } from 'meteor/meteor';
import { Session } from 'meteor/session';
import { TabBar } from '../../../ui-utils/client';
import { Subscriptions } from '../../../models/client';
Meteor.startup(function() {
return TabBar.addButton({
groups: ['channel', 'group', 'direct'],
id: 'thread',
i18nTitle: 'Threads',
icon: 'thread',
template: 'threads',
badge: () => {
const subscription = Subscriptions.findOne({ rid: Session.get('openedRoom') }, { fields: { tunread: 1 } });
if (subscription) {
return subscription.tunread && subscription.tunread.length && { body: subscription.tunread.length > 99 ? '99+' : subscription.tunread.length };
}
},
order: 0,
});
});