bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/notifications/container.jsx

28 lines
861 B
React
Raw Normal View History

2022-03-11 03:33:25 +08:00
import React from 'react';
import { FormattedMessage } from 'react-intl';
import { Notifications as NotificationsCollection } from '/imports/api/meetings';
import { notify } from '/imports/ui/services/notification';
import { withTracker } from 'meteor/react-meteor-data';
2022-04-06 05:02:05 +08:00
import WaitingUsersAlertService from '/imports/ui/components/waiting-users/alert/service';
2022-03-11 03:33:25 +08:00
export default withTracker(() => {
NotificationsCollection.find({}).observe({
added: (obj) => {
2022-04-06 05:02:05 +08:00
if (obj.messageId === 'app.userList.guest.pendingGuestAlert') {
return WaitingUsersAlertService.alert(obj);
}
2022-03-11 03:33:25 +08:00
notify(
<FormattedMessage
id={obj.messageId}
values={obj.messageValues}
description={obj.messageDescription}
2022-03-11 03:33:25 +08:00
/>,
obj.notificationType,
obj.icon,
);
},
});
return {};
})(() => null);