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/apps/meteor/client/components/AutoupdateToastMessage.tsx

27 lines
663 B

import { css } from '@rocket.chat/css-in-js';
import { Box, Button } from '@rocket.chat/fuselage';
import { useTranslation } from 'react-i18next';
import { useIdleActiveEvents } from '../hooks/useIdleActiveEvents';
export const AutoupdateToastMessage = () => {
const { t } = useTranslation();
useIdleActiveEvents({ id: 'autoupdate', awayOnWindowBlur: true }, () => {
window.location.reload();
});
return (
<Box
display='flex'
alignItems='center'
className={css`
gap: 8px;
`}
>
{t('An_update_is_available')}
<Button primary small onClick={() => window.location.reload()}>
{t('Reload_to_update')}
</Button>
</Box>
);
};