bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/screenreader-alert/service.js
2023-02-23 11:23:51 -03:00

20 lines
434 B
JavaScript

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