mirror of
https://github.com/lux-tel/session-desktop.git
synced 2026-10-30 20:33:24 +00:00
20 lines
719 B
TypeScript
20 lines
719 B
TypeScript
import useInterval from 'react-use/lib/useInterval';
|
|
import { getAppDispatch } from '../state/dispatch';
|
|
import { releasedFeaturesActions } from '../state/ducks/releasedFeatures';
|
|
import { NetworkTime } from '../util/NetworkTime';
|
|
import { FEATURE_RELEASE_CHECK_INTERVAL } from '../state/ducks/types/releasedFeaturesReduxTypes';
|
|
|
|
// NOTE: this is not used anywhere yet, but we may want it it in the future
|
|
export function useCheckReleasedFeatures() {
|
|
const dispatch = getAppDispatch();
|
|
|
|
useInterval(() => {
|
|
const nowFromNetwork = NetworkTime.now();
|
|
dispatch(
|
|
releasedFeaturesActions.updateReleasedFeatures({
|
|
refreshedAt: nowFromNetwork,
|
|
})
|
|
);
|
|
}, FEATURE_RELEASE_CHECK_INTERVAL);
|
|
}
|