71dbe06dfd
* fix: restore screen reader alerts for unread chat messages * fix: move screen reader alert adapter up the component tree
21 lines
318 B
TypeScript
21 lines
318 B
TypeScript
import { uniqueId } from '/imports/utils/string-utils';
|
|
import Queue from './queue';
|
|
|
|
export const addAlert = (text: string) => {
|
|
const alert = {
|
|
id: uniqueId('alert-'),
|
|
text,
|
|
};
|
|
|
|
Queue.push(alert);
|
|
};
|
|
|
|
export const shiftAlert = () => {
|
|
Queue.shift();
|
|
};
|
|
|
|
export default {
|
|
addAlert,
|
|
shiftAlert,
|
|
};
|