bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/chat/alert/container.jsx

25 lines
903 B
React
Raw Normal View History

import React, { memo } from 'react';
import { withTracker } from 'meteor/react-meteor-data';
import UserListService from '/imports/ui/components/user-list/service';
2017-03-29 02:41:48 +08:00
import Settings from '/imports/ui/services/settings';
import ChatAlert from './component';
2019-01-14 21:23:35 +08:00
import Auth from '/imports/ui/services/auth';
import Users from '/imports/api/users';
const ChatAlertContainer = props => (
<ChatAlert {...props} />
);
export default withTracker(() => {
2017-03-29 02:41:48 +08:00
const AppSettings = Settings.application;
2019-01-14 21:23:35 +08:00
const activeChats = UserListService.getActiveChats();
const { loginTime } = Users.findOne({ userId: Auth.userID }, { fields: { loginTime: 1 } });
return {
2019-01-14 21:23:35 +08:00
audioAlertDisabled: !AppSettings.chatAudioAlerts,
pushAlertDisabled: !AppSettings.chatPushAlerts,
activeChats,
publicUserId: Meteor.settings.public.chat.public_group_id,
2019-01-14 21:23:35 +08:00
joinTimestamp: loginTime,
};
})(memo(ChatAlertContainer));