bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/screenreader-alert/service.js

20 lines
434 B
JavaScript
Raw Normal View History

import ScreenReaderAlertCollection from './collection';
2023-02-23 22:23:51 +08:00
import { uniqueId } from '/imports/utils/string-utils';
export const addNewAlert = (text) => {
const payload = {
2023-02-23 22:23:51 +08:00
id: uniqueId('alert-'),
insertedTime: Date.now(),
text,
};
return ScreenReaderAlertCollection.insert(payload);
};
export const removeAlert = (id) => ScreenReaderAlertCollection.remove({ id });
export default {
addNewAlert,
removeAlert,
};