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