The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/client/providers/ToastMessagesProvider.js

20 lines
557 B

import React from 'react';
import toastr from 'toastr';
import { ToastMessagesContext } from '../contexts/ToastMessagesContext';
import { handleError } from '../../app/utils/client';
const dispatch = ({ type, message, title, options }) => {
if (type === 'error' && typeof message === 'object') {
handleError(message);
return;
}
toastr[type](message, title, options);
};
const contextValue = { dispatch };
export function ToastMessagesProvider({ children }) {
return <ToastMessagesContext.Provider children={children} value={contextValue} />;
}