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/ConnectionStatusProvider.tsx

21 lines
591 B

import { Meteor } from 'meteor/meteor';
import React, { FC } from 'react';
import {
ConnectionStatusContext,
ConnectionStatusContextValue,
} from '../contexts/ConnectionStatusContext';
import { useReactiveValue } from '../hooks/useReactiveValue';
const getValue = (): ConnectionStatusContextValue => ({
...Meteor.status(),
reconnect: Meteor.reconnect,
});
const ConnectionStatusProvider: FC = ({ children }) => {
const status = useReactiveValue(getValue);
return <ConnectionStatusContext.Provider children={children} value={status} />;
};
export default ConnectionStatusProvider;